Changing the 'Initial State' of a flow's configuration from 'stopped' to 'started'?

半世苍凉 提交于 2019-12-23 06:01:13

问题


How do you change the 'Initial State' of a flow's configuration from 'stopped' to 'started'? I have a flow that I want to turn on only when a certain condition is met at startup.


回答1:


There is 2 ways to do in runtime:- 1) Use Groovy component to start a flow :-

<scripting:component>
    <scripting:script engine="groovy">
        muleContext.registry.lookupFlowConstruct('targetFlow').start()
    </scripting:script>
</scripting:component>

where targetFlow is the name of the flow you need to start

or Second way is :- Use a expression component to start a flow ... here flow1 is the name of the flow to start :-

<expression-component>

    app.registry.flow1.start();

  </expression-component>


来源:https://stackoverflow.com/questions/23024276/changing-the-initial-state-of-a-flows-configuration-from-stopped-to-starte

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!