如何在Mulesoft中实现IF

Reg*_*son 2 if-statement choice mule

我想在Mulesoft流程中做出决定,并研究了Choice Flow Control。我的问题是,如果条件为true,我想做某事,如果条件为false,我什么也不想做,例如:

if (condition == true)
   do some work
Run Code Online (Sandbox Code Playgroud)

或者,在可能不正确的xml中:

<choice doc:name="call a subflow if the test is true">
    <when expression="#[flowVars.someVariable == True]">
        <flow-ref name="doSomething" doc:name="do another thing"/>
    </when>
</choice>
Run Code Online (Sandbox Code Playgroud)

没有else子句,也没有默认流。如何在Mulesoft流中实现?我可能会作弊,并向默认流程中发送日志记录调用,但我不希望这样做。

Rya*_*ter 5

不幸的是,Mule中没有简单的“ if”处理器。选择虚拟的路由或过滤器是目前的方法。

这里有一个很好的讨论:https : //www.mulesoft.org/jira/browse/MULE-6129。这进一步链接到可能的增强功能,例如if / tourtour路由器。

ule子4更新

在m子4中,您现在可以定义不需要otherwise路由的选择路由器。并且过滤器不再存在