Mailbox Add Service adds same message repeatedly inside a loop

Technote (troubleshooting)


Problem(Abstract)

Mailbox Add Service adds same message repeatedly inside a loop

Symptom

After collecting all the files using a FSA or from MQ, these collected messages when tried to put in a mailbox, same message gets added by Mailbox Add Service which is used in a loop.


Cause

The cause is both PrimaryDocument and Document ID existing in the ProcessData.If both PrimaryDocument and Document ID are present in the ProcessData, PrimaryDocument will be ignored and Document ID will be considered by the Mailbox Add Service.

Diagnosing the problem

There are no issues when Mailbox Add Service gets executed once and not in a loop.

When there is a loop and a DocumentID is already present in the ProcessData, and, Mailbox Add Service gets executed for the second time the issue can occur.


Resolving the problem

You can add all the messages in the mailbox using Mailbox Add Service inside the loop. You can use For Each Document Service to loop through all the files collected from a FSA. However it is important to use Release Service also inside the loop to remove the nodes - "DocumentId" and "MessageName". If these nodes are not removed, content in the first document will be put in all the messages added to the Mailbox and all the name of the messages added will also be the name of the first document.


Here is a sample Business Process for reference :
------------------------------------------------
<process name="mbadd_sample_ForEach">
<rule name="DocFound">
<condition>DOC.DONE = 1</condition>
</rule>

<sequence name="Pull Sequence">
<operation name="File System Adapter">
<participant name="EDIInboundFSAdapter"/>
<output message="FileSystemInputMessage">
<assign to="Action">FS_COLLECT</assign>
<assign to="bootstrap">false</assign>
<assign to="collectMultiple">true</assign>
<assign to="sortBy">FS_FILENAME</assign>
<assign to="deleteAfterCollect">false</assign>
<assign to="." from="*"></assign>
</output>
<input message="inmsg">
<assign to="." from="*"></assign>
</input>
</operation>

<sequence name="DocLoop">
<operation name="For Each Document">
<participant name="ForEachDocument"/>
<output message="ForEachDocumentTypeInputMessage">
<assign to="." from="*"></assign>
<assign to="ITERATOR_NAME">DOC</assign>
</output>
<input message="inmsg">
<assign to="." from="*"></assign>
</input>
</operation>

<choice name="Choice Start">
<select>
<case ref="DocFound" negative="true" activity="AddMailbox"/>
</select>

<sequence name="AddMailbox">

<operation name="Mailbox Add Service">
<participant name="MailboxAdd"/>
<output message="MailboxAddServiceTypeInputMessage">
<assign to="." from="*"></assign>
<assign to="MailboxPath">/EDIInboundCollection</assign>
</output>
<input message="inmsg">
<assign to="." from="*"></assign>
</input>
</operation>

<operation name="release">
<participant name="ReleaseService"/>
<output message="Xout">
<assign to="TARGET">DocumentId | MessageName</assign>
</output>
<input message="Xin"/>
</operation>

<repeat name="Get Next Doc" ref="DocLoop"/>
</sequence>
</choice>
</sequence>
</sequence>
</process>
------------------------------------------------


Rate this page:

(0 users)Average rating

Document information


More support for:

Sterling B2B Integrator
Adapters

Software version:

5.2.4

Operating system(s):

All

Reference #:

1623183

Modified date:

2013-03-27

Translate my page

Machine Translation

Content navigation