Java 驼峰分割器返回ExpressionNode

Java 驼峰分割器返回ExpressionNode,java,apache-camel,dsl,Java,Apache Camel,Dsl,我有一条路线: from(SU_NAME) .choice() .when(STATUS_IS_OK) .to("xslt:xsl/RemoveNode.xsl") .split().tokenizeXML("Event", "Header").to(XP_NAME) .otherwise() .dynamicRouter

我有一条路线:

    from(SU_NAME)
        .choice()
            .when(STATUS_IS_OK)
                .to("xslt:xsl/RemoveNode.xsl")
                    .split().tokenizeXML("Event", "Header").to(XP_NAME)
            .otherwise()
                .dynamicRouter(method(router, "slip"))
    .end(); 
如果我移除拆分器,我会让一切正常工作,但在我的路线中使用它会让我:

java.lang.Error: Unresolved compilation problem: 
The method otherwise() is undefined for the type ExpressionNode

我需要斯普利特加入这条路线,你能帮我吗。我知道应该有choise ChoiceDefinition而不是ExpressionNode,而不是我如何修改代码来获得它。

请参阅此常见问题解答-为什么我不能在Java Camel路由中使用when/other?

乍一看,您的“拆分”似乎没有终止。试试这个:

from(SU_NAME)
    .choice()
        .when(STATUS_IS_OK)
            .to("xslt:xsl/RemoveNode.xsl")
            .split().tokenizeXML("Event", "Header")
                .to(XP_NAME)
            .end() /* <-- explicitly end the split here, that should help */
        .otherwise()
            .dynamicRouter(method(router, "slip"))
     .end(); 
from(SU_NAME)
.choice()
.何时(状态为OK)
.to(“xslt:xsl/RemoveNode.xsl”)
.split().tokenizeXML(“事件”、“标题”)
.to(XP\U名称)

.end()/*.to(XP_NAME).endChoice()有帮助。有趣的是我知道这篇文章,更有趣的是我在这个项目中使用endChoises实现了更复杂的路由:)但是这个路由突然让我觉得:“我不知道怎么做”。真的,谢谢!不,这不起作用,puting.endChoise()有帮助,测试也很好,但是对于更复杂的路由,endChoise正在破坏实际的流(我有很多路由测试失败),我使用了另一种技术来解决cast问题:与direct链接,这很有帮助。但看起来更好的方法是转向XMLDSL