Serdar Gökay created CAMEL-25367:
------------------------------------
Summary: camel-yaml-dsl - Route dump omits doCatch and doFinally
written as doTry properties
Key: CAMEL-25367
URL: https://issues.apache.org/jira/browse/CAMEL-25367
Project: Camel
Issue Type: Bug
Components: camel-yaml-dsl
Affects Versions: 4.22.1
Reporter: Serdar Gökay
The YAML DSL accepts {{doCatch}} and {{doFinally}} as properties of {{doTry}}
(they are in the doTry JSON model since CAMEL-21617):
{code:yaml}
- route:
id: demo
from:
uri: timer:demo?repeatCount=1
steps:
- doTry:
steps:
- throwException:
exceptionType: java.lang.IllegalStateException
message: boom
doCatch:
- exception:
- java.lang.IllegalStateException
steps:
- log:
message: caught
doFinally:
steps:
- log:
message: finally
{code}
The route runs as expected: "caught" and "finally" are logged.
The route dump does not contain the two blocks. With Camel 4.22.1, {{camel cmd
route-dump}} (YAML and XML) and {{camel validate normalize}} show the doTry
with only its throwException step:
{code:xml}
<route id="demo">
<from uri="timer:demo?repeatCount=1"/>
<doTry>
<throwException message="boom"
exceptionType="java.lang.IllegalStateException"/>
</doTry>
</route>
{code}
The same route with doCatch and doFinally written as steps inside
{{doTry.steps}} dumps both blocks.
On main, the YAML deserializer stores these properties with
{{TryDefinition.setCatchClauses}} and {{setFinallyClause}}, outside the
outputs. {{TryDefinition.checkInitialized}} copies catch and finally outputs
into those fields, but not the other way round.
{{ModelWriter.doWriteTryDefinition}} writes only {{getOutputs()}}.
Expected: the dump contains the doCatch and doFinally blocks for both YAML
forms.
Related: CAMEL-19307 (YAML route dumper), CAMEL-25114 (doTry runtime fixes).
_Claude Code on behalf of etzel-mes_
--
This message was sent by Atlassian Jira
(v8.20.10#820010)