kaoto-ui
kaoto-ui copied to clipboard
[Epic] Support expression dialect
Describe the Bug
We support
- from:
uri: timer:null
steps:
- set-body:
simple: test
but not
- from:
uri: timer:null
steps:
- set-body:
expression:
simple:
expression: test
Both needs to be supported as a dialect. Canvas should show same diagram on both route above. There're several EIPs uses expression, some of them has its step extension, but the others don't. Both of default Config tab and step extensions should make a fix for this.
Related Issues
- https://github.com/KaotoIO/kaoto-backend/issues/479
- https://github.com/KaotoIO/kaoto-backend/issues/547
- https://github.com/KaotoIO/kaoto-backend/issues/548
- https://github.com/KaotoIO/step-extension-repository/issues/405
- https://github.com/KaotoIO/kaoto-backend/issues/554
Steps to Reproduce the Bug or Issue
- Open source code editor
- Paste the 2nd YAML above
Screenshots or Videos
No response
Platform
- OS: [e.g. macOS, Windows, Linux]
- Browser: [e.g. Chrome, Safari, Firefox]
- Version: [e.g. 0.30.0]
We might be able to keep expression
object as-is in default config tab, with "disabled"-ish style and suggest user to configure in source code editor. but definitely not lose the data.
Split step is a good example which doesn't have a step extension, but already has expression
as a property. It looks like this now. If we are OK with this for 1.0, we can just do the same for existing step extensions. But eventually we will need to show the condition and let user configure in the same way across dialects.
The other option for post 1.0 is to align to the one of dialects we choose, and always convert into the chosen one. IMO it's not necessary to preserve the source code in a dialect user choose, as long as it's semantically preserved. It's just a kind of auto code formatting. If user wants to keep the source code at that level, they should use some other code editor alone. Or we can add hardcore source editing mode
which disables the canvas completely.
I am all for converting identical code into a single coding style. Consistency pushing the user into what are best practices.
This seems to be an another dialect to support
- from:
uri: timer:null
steps:
- set-body:
simple:
expression: test
resultType: String
And enforcing resultType
seems NOT to be supported with the simplest dialect (1st in the description). So if we go to the auto-converting route, we should choose one of the verbose styles.
https://stackoverflow.com/questions/75003733/apache-camel-yaml-dsl-expression-returning-custom-datatype
We need to test if it doesn't break expression
object when the condition is modified through default Config tab and step extensions (https://github.com/KaotoIO/step-extension-repository/issues/405), but blocked by https://github.com/KaotoIO/kaoto-backend/issues/554
Since the individual issues toward 1.0 are identified, I'm removing this from stabilization sprint, but keep this Epic open for the post 1.0 permanent fix for complete dialect support.