首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >file pdf,ppt文件.mulerequesteor

file pdf,ppt文件.mulerequesteor
EN

Stack Overflow用户
提问于 2015-04-04 22:25:43
回答 1查看 71关注 0票数 0
代码语言:javascript
复制
<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等。

有人建议解决这个问题吗?

EN

回答 1

Stack Overflow用户

发布于 2015-04-05 01:08:36

mule requester模块中可能存在导致此问题的错误错误,我已经为此问题报告了Jira

替代解决方案可以是:-创建单独的流并定义文件入站端点,该端点将拾取文件并将其分派到该流中的文件出站端点。现在,设置flow="stopped"的初始状态,并在文件出站后的流的末尾使用以下表达式:-

代码语言:javascript
复制
<scripting:component>
    <scripting:script engine="groovy">
        muleContext.registry.lookupFlowConstruct('targetFlow').stop()
    </scripting:script>
</scripting:component>

现在,这将在将文件调度到出站位置后停止流

现在用flow-ref从你的主流调用这个流

因为这个流的初始状态是stopped,所以这个流只有在您从主流中使用flow-ref调用此流时才会激活,而当您在文件出站端点之后使用脚本组件时,它将再次停用

更新了请根据您的要求尝试以下示例

代码语言:javascript
复制
    <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>
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/29447536

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档