davsclaus opened a new pull request, #27261:
URL: https://github.com/apache/camel/pull/27261

   [CAMEL-25258](https://issues.apache.org/jira/browse/CAMEL-25258)
   
   `camel_transform_route` had its own conversion code, which had fallen behind 
the route DSL converter of CAMEL-25254. That converter is already used by 
`camel transform route --format=java` and the source editor. This PR makes the 
MCP tool a thin wrapper around `RouteDslConverter`.
   
   ## What the tool gains
   
   - All DSLs both ways, Java included as a target. The Java output is a 
`RouteBuilder` class with its imports.
   - Rests, route templates, route configurations and beans are converted. 
Before, XML → YAML wrote the routes only and dropped the rest without a word.
   - The result is read back and compared with the source. A new `notes` field 
lists what differs or is not carried over, such as comments, or beans when 
converting to Java. The existing `note` field joins the notes.
   - What cannot be converted without running it, such as a processor lambda, 
throws a `ToolCallException` with the file line and the reason.
   
   ## Behaviour changes
   
   - Java routes are read by the Java DSL parser (`LwJavaParser`) instead of 
being compiled and loaded. The module no longer depends on 
`camel-java-joor-dsl`, which was only there for this tool (CAMEL-23756).
   - Property placeholders are kept as written, not resolved.
   - Semantic declarations (CAMEL-25138) are still refused, now with the same 
reason in YAML, XML and Java: `keep them in a separate declaration resource`.
     - A Java `semanticQuestions(this)` is now refused even when it declares 
nothing, because without running it the converter can't know that.
     - The semantic tests were updated to match, and `camel-semantic` is no 
longer a test dependency.
     - CAMEL-25257 will let camel-semantic carry its declarations over through 
a converter add-on SPI.
   
   Upgrade guide (4.23) and the MCP tool table in `camel-jbang-mcp.adoc` are 
updated.
   
   ## Tests
   
   - `TransformToolsTest` adds:
     - XML → Java (class, `routeId`, `LoggingLevel`, and a note about comments);
     - rests carried over to YAML with no notes;
     - a lambda refused with the reason;
     - placeholders kept.
   - The 422 camel-jbang-mcp tests pass, as do the camel-jbang-core 
`RouteDslConverterTest` and `Transform*Test`.
   
   _Claude Code on behalf of davsclaus_
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to