davsclaus opened a new pull request, #27228: URL: https://github.com/apache/camel/pull/27228
_Claude Code on behalf of davsclaus_ The new Switch EIP (CAMEL-24988) is a decision table: a selector, then `value → uri` cases and an otherwise. The route diagram drew it as a chain: the switch box, then each case as its own box below the previous one, joined by arrows. That had two problems: - **Too tall:** about 9 rows per case, so a table with many cases did not fit. - **Wrong meaning:** the arrows read as "case 1, then case 2", while a Switch picks one of them. Found with the semantic agent routing demo (Switch over 4 a2a specialists and an otherwise). **camel-diagram** (`RouteDiagramLayoutEngine`): a new opt-in table layout, `setTableLayout(true)`, off by default, so the PNG and ASCII dev console diagrams are unchanged. - A `switch` (`TABLE_EIPS`) is one node, twice the normal width, as tall as its rows (up to 8, plus a "more" line), and centered so the arrows in and out stay straight. - Its cases remain layout nodes, marked `tableRow` with their index, without arrows of their own. There is no scope box around them, and the next step connects from the table. **TUI** (`RouteDiagramWidget`), with the table layout on: - the selector in the top border; - one row per case: the value, `→`, the endpoint without its options, and its own message count (with metrics on); - the otherwise row last, with `↵` when it sends to a route of the integration. - Each row is a node: ↑↓ selects it (highlighted, Info panel), the history highlight colors the case taken, and Enter jumps along a `direct:` case. - A table of more than 8 cases shows a window of rows that follows the selection, with "↑ 31 cases, 14-21 shown ↓". - The switch and case nodes get the Choice color. **Note:** the runtime does not record statistics per case yet. Only `switch1` and `switch1-otherwise` are managed processors (`camel get processor`), so the case rows show no count until that is fixed in core, which is a separate issue. The `otherwise` row shows its count. Tests: `RouteDiagramLayoutEngineTest` (the chain is unchanged without the option; one wide table with rows; a long table's height is capped) and `SwitchTableTest` (rows with their counts, the otherwise jump marker, the window following the selection). camel-diagram (155) and the TUI module (1491) pass. 🤖 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]
