【发布时间】:2015-02-01 08:00:48
【问题描述】:
我正在尝试这种方法来自动启动 Mule 流
Starting a mule flow programmatically using groovy
它不会启动流程。这是使用 3.4.0 CE 在 Mule Studio 中运行的一个非常简单的测试
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:scripting="http://www.mulesoft.org/schema/mule/scripting"
xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
xmlns:spring="http://www.springframework.org/schema/beans" version="CE-3.4.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/scripting http://www.mulesoft.org/schema/mule/scripting/current/mule-scripting.xsd">
<flow name="auto2Flow1" doc:name="auto2Flow1">
<scripting:component doc:name="Groovy">
<scripting:script engine="Groovy">
muleContext.registry.lookupFlowConstruct('flow1').start()
</scripting:script>
</scripting:component>
</flow>
<flow name="flow1" doc:name="flow1">
<logger level="INFO" doc:name="Logger" message="hello"/>
</flow>
</mule>
我也试过了,没有运气
<expression-component>
app.registry.flow1.start();
</expression-component>
我假设 flow1 已自动注册但不确定。
【问题讨论】: