【问题标题】:Changing the 'Initial State' of a flow's configuration from 'stopped' to 'started'?将流配置的“初始状态”从“停止”更改为“开始”?
【发布时间】:2014-04-12 13:52:09
【问题描述】:

如何将流配置的“初始状态”从“已停止”更改为“已启动”?我有一个流程,我只想在启动时满足特定条件时才打开。

【问题讨论】:

    标签: mule


    【解决方案1】:

    在运行时有两种方法:- 1) 使用 Groovy 组件启动流程:-

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

    其中 targetFlow 是您需要启动的流程的名称

    或第二种方法是:- 使用表达式组件启动流程...这里 flow1 是要启动的流程的名称:-

    <expression-component>
    
        app.registry.flow1.start();
    
      </expression-component>
    

    【讨论】:

    • 此外,Groovy 组件的表达式可以简化为:targetFlow.start()
    猜你喜欢
    • 1970-01-01
    • 2022-01-21
    • 2021-01-15
    • 2019-05-08
    • 2020-11-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多