将流配置的“初始状态"从“停止"更改为“开始"? [英] Changing the 'Initial State' of a flow's configuration from 'stopped' to 'started'?

查看:61
本文介绍了将流配置的“初始状态"从“停止"更改为“开始"?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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.

推荐答案

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

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>

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

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

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

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>

这篇关于将流配置的“初始状态"从“停止"更改为“开始"?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆