vijayrhythm opened a new issue, #1437: URL: https://github.com/apache/camel-karavan/issues/1437
### Describe the bug When we add On Exception Definition with **OnWhen** statement with YAML DSL, it adds additional **when** statement unexpectedly when we switch between 'Routes' tab and 'YAML' tab. This cause failure. It appears to require a fix similar to issue [1420 ](https://github.com/apache/camel-karavan/commit/f8b5bd84624057f6fcf77424a5c0c1b46e6ec570#diff-7f543f0c99fab7d0f20b48c7f45a2e160f19c244067464cf7704d060ac11addd) where it resolved the same for CatchDefinition. Please could someone help to resolve it. Thanks. - route: id: route-d663 nodePrefixId: route-52e from: id: from-d6c1 uri: amqp steps: - choice: id: choice-d1e9 when: - id: when-19d8 expression: groovy: id: groovy-1c57 expression: 1=1 otherwise: id: otherwise-c779 - routeConfiguration: onException: - onException: id: onException-04a7 onWhen: **when**: id: when-61ee expression: simple: id: simple-c2b6 expression: ${exception.statusCode} == 500 ### Steps to reproduce the behavior 1. Create a flow adding On Exception with OnWhen step in a Route Configuration (below is an example) "- route: id: route-d663 nodePrefixId: route-52e from: id: from-d6c1 uri: amqp steps: - choice: id: choice-d1e9 when: - id: when-19d8 expression: groovy: id: groovy-1c57 expression: 1=1 otherwise: id: otherwise-c779 "- routeConfiguration: onException: "- onException: id: onException-04a7 **onWhen:** id: when-61ee expression: simple: id: simple-c2b6 expression: ${exception.statusCode} == 500 2. Switch between Routes (route view) and coming back to YAML editor 3. We see an additional 'when' statement below On When " - routeConfiguration: onException: - onException: id: onException-04a7 **onWhen: when:** id: when-e875 when: id: when-61ee expression: simple: id: simple-c2b6 expression: ${exception.statusCode} == 500 ### Variant Web Application ### Container Management (if applicable) None ### Operating System (if applicable) None ### Version 4.8.0 ### Relevant log output _No response_ -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@camel.apache.org.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org