<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,图像(
**
有没有其他方法可以将pdf,ppt文件移动到其他文件夹,仅由muletrequester使用。 因为这是我的需求
**.我要移动的文件,如PDF,PPT,图像等。
任何人都建议解决方案
骡子请求器模块中可能存在导致此问题的错误,我已经为此问题报告了 Jira
另一种解决方案可以是:-创建一个单独的流并定义一个文件入站终结点,该终结点将选取文件并调度到该流中的文件出站终结点。现在,使 flow="stop"> 的初始状态,并在文件出站后的流结束时使用以下表达式:-
<scripting:component>
<scripting:script engine="groovy">
muleContext.registry.lookupFlowConstruct('targetFlow').stop()
</scripting:script>
</scripting:component>
现在,这将在文件被分派到出站位置后停止流
现在使用 flow-ref
从您的主流调用此流由于此流的初始状态已停止,因此此流仅在您使用主流中的 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>