edi x12 850版本4010

时间:2016-03-22 11:05:45

标签: mule-studio edi

您好我正在使用mule ESB处理850 EDI并创建997确认,这对5010版本的配置正常,配置如下

                     /x12/005010/850.esl             /x12/005010/855.esl              

<flow name="ReceiveOrdersFromPartner" >
    <file:inbound-endpoint path="input" moveToPattern="processed.edi" moveToDirectory="processed" responseTimeout="10000" doc:name="File"/>
    <x12-edi:read config-ref="Walmart" doc:name="Read EDI Doc"/>
    <enricher target="flowVars.batchResult" doc:name="Message Enricher">
        <batch:execute name="Process850s" doc:name="Process850s"/>
    </enricher>

    <flow-ref name="SendAck" doc:name="Send Acks"/>
</flow>

<batch:job name="Process850s">
    <batch:threading-profile poolExhaustedAction="WAIT"/>
    <batch:input>
        <set-payload value="#[payload.TransactionSets.v005010['850']]" doc:name="Extract 850s"/>
    </batch:input>
    <batch:process-records>
        <batch:step name="ProcessLineItems">
               <dw:transform-message doc:name="Transform Message">
                    <dw:set-payload><![CDATA[%dw 1.0

%输出应用程序/ csv

payload.Detail&#34; 0100_PO1_Loop&#34;地图{     OrderId:$。&#39; 0100_PO1&#39; .PO101,     金额:$。&#39; 0100_PO1&#39; .PO104 * $。&#39; 0100_PO1&#39; .PO102 }]]&GT;                                                                                                                                         

但我需要处理4010版本文件,我尝试使用以下配置

<x12-edi:config name="Walmart" doc:name="EDI" groupIdSelf="RECEIVER" interchangeIdQualifierSelf="ZZ" 
interchangeIdSelf="RECEIVER" groupIdPartner="SENDER" interchangeIdPartner="SENDER" interchangeIdQualifierPartner="ZZ" >
    <x12-edi:schemas>
        <x12-edi:schema>/x12/004010/850.esl</x12-edi:schema>
        <x12-edi:schema>/x12/004010/855.esl</x12-edi:schema>
    </x12-edi:schemas>
</x12-edi:config>

<flow name="ReceiveOrdersFromPartner" >
    <file:inbound-endpoint path="input" moveToPattern="processed.edi" moveToDirectory="processed" responseTimeout="10000" doc:name="File"/>
    <x12-edi:read config-ref="Walmart" doc:name="Read EDI Doc"/>
    <enricher target="flowVars.batchResult" doc:name="Message Enricher">
        <batch:execute name="Process850s" doc:name="Process850s"/>
    </enricher>

    <flow-ref name="SendAck" doc:name="Send Acks"/>
</flow>

<batch:job name="Process850s">
    <batch:threading-profile poolExhaustedAction="WAIT"/>
    <batch:input>
        <set-payload value="#[payload.TransactionSets.v4010['850']]" doc:name="Extract 850s"/>
    </batch:input>
    <batch:process-records>
        <batch:step name="ProcessLineItems">
               <dw:transform-message doc:name="Transform Message">
                    <dw:set-payload><![CDATA[%dw 1.0

%输出应用程序/ csv

payload.Detail&#34; 0100_PO1_Loop&#34;地图{     OrderId:$。&#39; 0100_PO1&#39; .PO101,     金额:$。&#39; 0100_PO1&#39; .PO104 * $。&#39; 0100_PO1&#39; .PO102 }]]&GT;                                                                                                                                         

但在阅读文件时我遇到了错误

org.mule.api.MessagingException:执行表达式&#34; payload.TransactionSets.v4010 [&#39; 850&#39;]&#34;失败。 (org.mule.api.expression.ExpressionRuntimeException)。消息有效内容的类型为:HashMap     at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:32)〜[mule-core-3.7.3.jar:3.7.3]     在org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:107)〜[mule-core-3.7.3.jar:3.7.3]     在org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44)〜[mule-core-3.7.3.jar:3.7.3]     在org.mule.processor.BlockingProcessorExecutor.executeNext(BlockingProcessorExecutor.java:88)〜[mule-core-3.7.3.jar:3.7.3]     at org.mule.processor.BlockingProcessorExecutor.execute(BlockingProcessorExecutor.java:59)〜[mule-core-3.7.3.jar:3.7.3]     在org.mule.processor.chain.DefaultMessageProcessorChain.doProcess(DefaultMessageProcessorChain.java:80)〜[mule-core-3.7.3.jar:3.7.3]     在org.mule.processor.chain.AbstractMessageProcessorChain.process(AbstractMessageProcessorChain.java:76)〜[mule-core-3.7.3.jar:3.7.3]     at org.mule.processor.chain.InterceptingChainLifecycleWrapper.doProcess(InterceptingChainLifecycleWrapper.java:50)〜[mule-core-3.7.3.jar:3.7.3]     在org.mule.processor.chain.AbstractMessageProcessorChain.process(AbstractMessageProcessorChain.java:76)〜[mule-core-3.7.3.jar:3.7.3]     at org.mule.processor.chain.InterceptingChainLifecycleWrapper.access $ 001(InterceptingChainLifecycleWrapper.java:22)〜[mule-core-3.7.3.jar:3.7.3]     在org.mule.processor.chain.InterceptingChainLifecycleWrapper $ 1.process(InterceptingChainLifecycleWrapper.java:66)〜[mule-core-3.7.3.jar:3.7.3]     at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24)〜[mule-core-3.7.3.jar:3.7.3]     在org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:107)〜[mule-core-3.7.3.jar:3.7.3]     在org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44)〜[mule-core-3.7.3.jar:3.7.3]     at org.mule.processor.chain.InterceptingChainLifecycleWrapper.process(InterceptingChainLifecycleWrapper.java:61)〜[mule-core-3.7.3.jar:3.7.3]     在com.mulesoft.module.batch.BatchMessageBlock.process(BatchMessageBlock.java:41)〜[mule-module-batch-ee-3.7.3.jar:3.7.3]     在com.mulesoft.module.batch.BatchInputBlock.process(BatchInputBlock.java:75)〜[mule-module-batch-ee-3.7.3.jar:3.7.3]     在com.mulesoft.module.batch.engine.BatchProcessingTemplate.process(BatchProcessingTemplate.java:83)〜[mule-module-batch-ee-3.7.3.jar:3.7.3]     在com.mulesoft.module.batch.engine.DefaultBatchEngine.processInput(DefaultBatchEngine.java:262)〜[mule-module-batch-ee-3.7.3.jar:3.7.3]     在com.mulesoft.module.batch.DefaultBatchJob.execute(DefaultBatchJob.java:301)〜[mule-module-batch-ee-3.7.3.jar:3.7.3]     在com.mulesoft.module.batch.processor.BatchExecuteMessageProcessor.process(BatchExecuteMessageProcessor.java:48)〜[mule-module-batch-ee-3.7.3.jar:3.7.3]     at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24)〜[mule-core-3.7.3.jar:3.7.3]     在org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:107)〜[mule-core-3.7.3.jar:3.7.3]     在org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44)〜[mule-core-3.7.3.jar:3.7.3]     在org.mule.processor.BlockingProcessorExecutor.executeNext(BlockingProcessorExecutor.java:88)〜[mule-core-3.7.3.jar:3.7.3]     at org.mule.processor.BlockingProcessorExecutor.execute(BlockingProcessorExecutor.java:59)〜[mule-core-3.7.3.jar:3.7.3]     在org.mule.processor.chain.DefaultMessageProcessorChain.doProcess(DefaultMessageProcessorChain.java:80)〜[mule-core-3.7.3.jar:3.7.3]     在org.mule.processor.chain.AbstractMessageProcessorChain.process(AbstractMessageProcessorChain.java:76)〜[mule-core-3.7.3.jar:3.7.3]     at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24)〜[mule-core-3.7.3.jar:3.7.3]     在org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44)〜[mule-core-3.7.3.jar:3.7.3]     at org.mule.processor.BlockingProcessorExecutor.executeNext(BlockingProcessorExecutor.java:98)〜[mule-core-3.7.3.jar:3.7.3]     at org.mule.processor.BlockingProcessorExecutor.execute(BlockingProcessorExecutor.java:59)〜[mule-core-3.7.3.jar:3.7.3]     at org.mule.processor.AbstractInterceptingMessageProcessorBase.processNext(AbstractInterceptingMessageProcessorBase.java:98)〜[mule-core-3.7.3.jar:3.7.3]     at org.mule.processor.AbstractRequestResponseMessageProcessor.processBlocking(AbstractRequestResponseMessageProcessor.java:56)〜[mule-core-3.7.3.jar:3.7.3]     在org.mule.enricher.MessageEnricher $ EnricherProcessor.processBlocking(MessageEnricher.java:214)〜[mule-core-3.7.3.jar:3.7.3]     at org.mule.processor.AbstractRequestResponseMessageProcessor.process(AbstractRequestResponseMessageProcessor.java:47)〜[mule-core-3.7.3.jar:3.7.3]     在org.mule.enricher.MessageEnricher.process(MessageEnricher.java:71)〜[mule-core-3.7.3.jar:3.7.3]     at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24)〜[mule-core-3.7.3.jar:3.7.3]     在org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:107)〜[mule-core-3.7.3.jar:3.7.3]     在org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44)〜[mule-core-3.7.3.jar:3.7.3]     在org.mule.processor.BlockingProcessorExecutor.executeNext(BlockingProcessorExecutor.java:88)〜[mule-core-3.7.3.jar:3.7.3]     at org.mule.processor.BlockingProcessorExecutor.execute(BlockingProcessorExecutor.java:59)〜[mule-core-3.7.3.jar:3.7.3]     在org.mule.processor.chain.DefaultMessageProcessorChain.doProcess(DefaultMessageProcessorChain.java:80)〜[mule-core-3.7.3.jar:3.7.3]     在org.mule.processor.chain.AbstractMessageProcessorChain.process(AbstractMessageProcessorChain.java:76)〜[mule-core-3.7.3.jar:3.7.3]     at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24)〜[mule-core-3.7.3.jar:3.7.3]     在org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44)〜[mule-core-3.7.3.jar:3.7.3]     at org.mule.processor.BlockingProcessorExecutor.executeNext(BlockingProcessorExecutor.java:98)〜[mule-core-3.7.3.jar:3.7.3]     at org.mule.processor.BlockingProcessorExecutor.execute(BlockingProcessorExecutor.java:59)〜[mule-core-3.7.3.jar:3.7.3]     at org.mule.processor.AbstractInterceptingMessageProcessorBase.processNext(AbstractInterceptingMessageProcessorBase.java:98)〜[mule-core-3.7.3.jar:3.7.3]     at org.mule.interceptor.AbstractEnvelopeInterceptor.processBlocking(AbstractEnvelopeInterceptor.java:58)〜[mule-core-3.7.3.jar:3.7.3]     at org.mule.processor.AbstractRequestResponseMessageProcessor.process(AbstractRequestResponseMessageProcessor.java:47)〜[mule-core-3.7.3.jar:3.7.3]     在org.mule.processor.AsyncInterceptingMessageProcessor.processNextTimed(AsyncInterceptingMessageProcessor.java:123)〜[mule-core-3.7.3.jar:3.7.3]     at org.mule.processor.AsyncInterceptingMessageProcessor $ AsyncMessageProcessorWorker $ 1.process(AsyncInterceptingMessageProcessor.java:208)~ [mule-core-3.7.3.jar:3.7.3]     at org.mule.processor.AsyncInterceptingMessageProcessor $ AsyncMessageProcessorWorker $ 1.process(AsyncInterceptingMessageProcessor.java:201)〜[mule-core-3.7.3.jar:3.7.3]     在org.mule.execution.ExecuteCallbackInterceptor.execute(ExecuteCallbackInterceptor.java:16)〜[mule-core-3.7.3.jar:3.7.3]     在org.mule.execution.CommitTransactionInterceptor.execute(CommitTransactionInterceptor.java:35)〜[mule-core-3.7.3.jar:3.7.3]     在org.mule.execution.CommitTransactionInterceptor.execute(CommitTransactionInterceptor.java:22)〜[mule-core-3.7.3.jar:3.7.3]     在org.mule.execution.HandleExceptionInterceptor.execute(HandleExceptionInterceptor.java:30)〜[mule-core-3.7.3.jar:3.7.3]     在org.mule.execution.HandleExceptionInterceptor.execute(HandleExceptionInterceptor.java:14)〜[mule-core-3.7.3.jar:3.7.3]     在org.mule.execution.BeginAndResolveTransactionInterceptor.execute(BeginAndResolveTransactionInterceptor.java:67)〜[mule-core-3.7.3.jar:3.7.3]     在org.mule.execution.ResolvePreviousTransactionInterceptor.execute(ResolvePreviousTransactionInterceptor.java:44)〜[mule-core-3.7.3.jar:3.7.3]     在org.mule.execution.SuspendXaTransactionInterceptor.execute(SuspendXaTransactionInterceptor.java:50)〜[mule-core-3.7.3.jar:3.7.3]     在org.mule.execution.ValidateTransactionalStateInterceptor.execute(ValidateTransactionalStateInterceptor.java:40)〜[mule-core-3.7.3.jar:3.7.3]     在org.mule.execution.IsolateCurrentTransactionInterceptor.execute(IsolateCurrentTransactionInterceptor.java:41)〜[mule-core-3.7.3.jar:3.7.3]     在org.mule.execution.ExternalTransactionInterceptor.execute(ExternalTransactionInterceptor.java:48)〜[mule-core-3.7.3.jar:3.7.3]     在org.mule.execution.RethrowExceptionInterceptor.execute(RethrowExceptionInterceptor.java:28)〜[mule-core-3.7.3.jar:3.7.3]     在org.mule.execution.RethrowExceptionInterceptor.execute(RethrowExceptionInterceptor.java:13)〜[mule-core-3.7.3.jar:3.7.3]     在org.mule.execution.TransactionalErrorHandlingExecutionTemplate.execute(TransactionalErrorHandlingExecutionTemplate.java:110)〜[mule-core-3.7.3.jar:3.7.3]     在org.mule.execution.TransactionalErrorHandlingExecutionTemplate.execute(TransactionalErrorHandlingExecutionTemplate.java:30)〜[mule-core-3.7.3.jar:3.7.3]     at org.mule.processor.AsyncInterceptingMessageProcessor $ AsyncMessageProcessorWorker.doRun(AsyncInterceptingMessageProcessor.java:200)〜[mule-core-3.7.3.jar:3.7.3]     在org.mule.work.AbstractMuleEventWork.run(AbstractMuleEventWork.java:49)〜[mule-core-3.7.3.jar:3.7.3]     在org.mule.work.WorkerContext.run(WorkerContext.java:286)〜[mule-core-3.7.3.jar:3.7.3]     at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)[?:1.8.0_31]     at java.util.concurrent.ThreadPoolExecutor $ Worker.run(Unknown Source)[?:1.8.0_31]     在java.lang.Thread.run(未知来源)[?:1.8.0_31] 引起:org.mule.api.expression.ExpressionRuntimeException:执行表达式&#34; payload.TransactionSets.v4010 [&#39; 850&#39;]&#34;失败。     在org.mule.el.mvel.MVELExpressionLanguage.evaluateInternal(MVELExpressionLanguage.java:232)〜[mule-core-3.7.3.jar:3.7.3]     在org.mule.el.mvel.MVELExpressionLanguage.evaluate(MVELExpressionLanguage.java:192)〜[mule-core-3.7.3.jar:3.7.3]     at org.mule.el.mvel.MVELExpressionLanguage.evaluate(MVELExpressionLanguage.java:170)~ [mule-core-3.7.3.jar:3.7.3]     在org.mule.el.mvel.MVELExpressionLanguage.evaluateTyped(MVELExpressionLanguage.java:212)〜[mule-core-3.7.3.jar:3.7.3]     at org.mule.expression.DefaultExpressionManager.evaluateTyped(DefaultExpressionManager.java:580)~ [mule-core-3.7.3.jar:3.7.3]     在org.mule.util.AttributeEvaluator.resolveTypedValue(AttributeEvaluator.java:106)〜[mule-core-3.7.3.jar:3.7.3]     at org.mule.transformer.simple.SetPayloadMessageProcessor.resolveTypedValue(SetPayloadMessageProcessor.java:79)〜[mule-core-3.7.3.jar:3.7.3]     在org.mule.transformer.simple.SetPayloadMessageProcessor.process(SetPayloadMessageProcessor.java:43)〜[mule-core-3.7.3.jar:3.7.3]     at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:24)〜[mule-core-3.7.3.jar:3.7.3]     ......还有61个

有人可以帮助我吗

1 个答案:

答案 0 :(得分:1)

在这里猜一下,因为我还不知道骡子,但我猜这个 payload.TransactionSets.v4010['850']
实际应该是
payload.TransactionSets.v004010['850']