0
votes

Hi I am using mule ESB to process 850 EDI and create the 997 acknowledgement which was working fine for 5010 version with below configuration

/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

%output application/csv

payload.Detail."0100_PO1_Loop" map { OrderId: $.'0100_PO1'.PO101, Amount: $.'0100_PO1'.PO104 * $.'0100_PO1'.PO102 }]]>

but I need to process 4010 version file and I aam trying with below configuration

<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

%output application/csv

payload.Detail."0100_PO1_Loop" map { OrderId: $.'0100_PO1'.PO101, Amount: $.'0100_PO1'.PO104 * $.'0100_PO1'.PO102 }]]>

but While reading the file I am getting following error

org.mule.api.MessagingException: Execution of the expression "payload.TransactionSets.v4010['850']" failed. (org.mule.api.expression.ExpressionRuntimeException). Message payload is of type: HashMap at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:32) ~[mule-core-3.7.3.jar:3.7.3] at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:107) ~[mule-core-3.7.3.jar:3.7.3] at 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: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] at org.mule.processor.chain.DefaultMessageProcessorChain.doProcess(DefaultMessageProcessorChain.java:80) ~[mule-core-3.7.3.jar:3.7.3] at 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] at 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] at 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] at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:107) ~[mule-core-3.7.3.jar:3.7.3] at 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] at com.mulesoft.module.batch.BatchMessageBlock.process(BatchMessageBlock.java:41) ~[mule-module-batch-ee-3.7.3.jar:3.7.3] at com.mulesoft.module.batch.BatchInputBlock.process(BatchInputBlock.java:75) ~[mule-module-batch-ee-3.7.3.jar:3.7.3] at com.mulesoft.module.batch.engine.BatchProcessingTemplate.process(BatchProcessingTemplate.java:83) ~[mule-module-batch-ee-3.7.3.jar:3.7.3] at com.mulesoft.module.batch.engine.DefaultBatchEngine.processInput(DefaultBatchEngine.java:262) ~[mule-module-batch-ee-3.7.3.jar:3.7.3] at com.mulesoft.module.batch.DefaultBatchJob.execute(DefaultBatchJob.java:301) ~[mule-module-batch-ee-3.7.3.jar:3.7.3] at 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] at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:107) ~[mule-core-3.7.3.jar:3.7.3] at 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: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] at org.mule.processor.chain.DefaultMessageProcessorChain.doProcess(DefaultMessageProcessorChain.java:80) ~[mule-core-3.7.3.jar:3.7.3] at 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] at 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] at 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] at 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] at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:107) ~[mule-core-3.7.3.jar:3.7.3] at 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: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] at org.mule.processor.chain.DefaultMessageProcessorChain.doProcess(DefaultMessageProcessorChain.java:80) ~[mule-core-3.7.3.jar:3.7.3] at 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] at 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] at 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] at org.mule.execution.ExecuteCallbackInterceptor.execute(ExecuteCallbackInterceptor.java:16) ~[mule-core-3.7.3.jar:3.7.3] at org.mule.execution.CommitTransactionInterceptor.execute(CommitTransactionInterceptor.java:35) ~[mule-core-3.7.3.jar:3.7.3] at org.mule.execution.CommitTransactionInterceptor.execute(CommitTransactionInterceptor.java:22) ~[mule-core-3.7.3.jar:3.7.3] at org.mule.execution.HandleExceptionInterceptor.execute(HandleExceptionInterceptor.java:30) ~[mule-core-3.7.3.jar:3.7.3] at org.mule.execution.HandleExceptionInterceptor.execute(HandleExceptionInterceptor.java:14) ~[mule-core-3.7.3.jar:3.7.3] at org.mule.execution.BeginAndResolveTransactionInterceptor.execute(BeginAndResolveTransactionInterceptor.java:67) ~[mule-core-3.7.3.jar:3.7.3] at org.mule.execution.ResolvePreviousTransactionInterceptor.execute(ResolvePreviousTransactionInterceptor.java:44) ~[mule-core-3.7.3.jar:3.7.3] at org.mule.execution.SuspendXaTransactionInterceptor.execute(SuspendXaTransactionInterceptor.java:50) ~[mule-core-3.7.3.jar:3.7.3] at org.mule.execution.ValidateTransactionalStateInterceptor.execute(ValidateTransactionalStateInterceptor.java:40) ~[mule-core-3.7.3.jar:3.7.3] at org.mule.execution.IsolateCurrentTransactionInterceptor.execute(IsolateCurrentTransactionInterceptor.java:41) ~[mule-core-3.7.3.jar:3.7.3] at org.mule.execution.ExternalTransactionInterceptor.execute(ExternalTransactionInterceptor.java:48) ~[mule-core-3.7.3.jar:3.7.3] at org.mule.execution.RethrowExceptionInterceptor.execute(RethrowExceptionInterceptor.java:28) ~[mule-core-3.7.3.jar:3.7.3] at org.mule.execution.RethrowExceptionInterceptor.execute(RethrowExceptionInterceptor.java:13) ~[mule-core-3.7.3.jar:3.7.3] at org.mule.execution.TransactionalErrorHandlingExecutionTemplate.execute(TransactionalErrorHandlingExecutionTemplate.java:110) ~[mule-core-3.7.3.jar:3.7.3] at 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] at org.mule.work.AbstractMuleEventWork.run(AbstractMuleEventWork.java:49) ~[mule-core-3.7.3.jar:3.7.3] at 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] at java.lang.Thread.run(Unknown Source) [?:1.8.0_31] Caused by: org.mule.api.expression.ExpressionRuntimeException: Execution of the expression "payload.TransactionSets.v4010['850']" failed. at org.mule.el.mvel.MVELExpressionLanguage.evaluateInternal(MVELExpressionLanguage.java:232) ~[mule-core-3.7.3.jar:3.7.3] at 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] at 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] at 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] at 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 more

Could some one help me on this

1

1 Answers

1
votes

Just a guess here as I don't know Mule yet, but I'd guess that
payload.TransactionSets.v4010['850']
should actually be
payload.TransactionSets.v004010['850']