<mulerequester:request config-ref="Mule_Requester1" resource="file:///#[flowVars.filename]" doc:name="Mule Requester"/>
<object-to-byte-array-transformer/>
<file:outbound-endpoint path="C:\OUTPUT" responseTimeout="10000" doc:name="Filewrite" outputPattern="#[flowVars.inpfilename]"/>请注意以下几点
上述流程将在C:\OUTPUT文件夹中创建格式损坏的文件(pdf、ppt、image
**
有没有其他的方法来移动pdf,ppt文件到其他文件夹使用只由muletrequester。因为这是我的需求
**。我想要移动的文件,如pdf,ppt,image等。
有人建议解决这个问题吗?
发布于 2015-04-05 01:08:36
在mule requester模块中可能存在导致此问题的错误错误,我已经为此问题报告了Jira。
替代解决方案可以是:-创建单独的流并定义文件入站端点,该端点将拾取文件并将其分派到该流中的文件出站端点。现在,设置flow="stopped"的初始状态,并在文件出站后的流的末尾使用以下表达式:-
<scripting:component>
<scripting:script engine="groovy">
muleContext.registry.lookupFlowConstruct('targetFlow').stop()
</scripting:script>
</scripting:component>现在,这将在将文件调度到出站位置后停止流
现在用flow-ref从你的主流调用这个流
因为这个流的初始状态是stopped,所以这个流只有在您从主流中使用flow-ref调用此流时才会激活,而当您在文件出站端点之后使用脚本组件时,它将再次停用
更新了请根据您的要求尝试以下示例
<flow name="mainflow" doc:name="mainflow">
<!-- your previous code -->
<foreach collection="#[payload]" doc:name="For Each">
<flow-ref name="fileFlow" doc:name="Flow Reference"/>
</foreach>
</flow>
<flow name="fileFlow" doc:name="fileFlow" initialState="stopped">
<!--Here your file inbound with use sessionVar as path instead of flowVars-->
<!-- file outbound and path as sessionVar -->
<scripting:component>
<scripting:script engine="groovy">
muleContext.registry.lookupFlowConstruct('fileFlow').start()
</scripting:script>
</scripting:component>
</flow>https://stackoverflow.com/questions/29447536
复制相似问题