Modeling Guidelines for Large File Handling

To ensure efficient processing of large files, you must configure your business process models to prevent unnecessary overloading of the database, which can lead to production down scenarios.

Using the For Each Document service along with an Invoke Business Process service in a loop can be a source of production down issues when handling files of any size, but particularly for large files.

A considerable number of documents repeating through the For Each Document service, followed by an Invoke Business Process service, which carries forward all parent documents and process data, causes systems to become overwhelmed by data volume that grows on each cycle through the loop.

Because each child process has a copy of the parent process' original document, and there are N documents to cycle through the loop, N times the amount of documents carry forward. For very large documents or a large number of documents, this can fill the database.

To avoid this problem, structure your business process model as indicated in one of the two methods described here:

Method 1

In your business process model, include:

  • An Assign activity with a message_to_child element that selectively passes the correct document (and any other selected data) to the next cycle in the loop
  • A Release Service placed to clear out unneeded document copies (do not place the Release service between the Assign activity to message_to_child and the Invoke Business Process service, because in that configuration it will remove the desirable data)

Method 2

In your business process model, include one or more assign elements to message_to_child in the Message To Service of the Invoke Business Process service, to specify the correct document as an output element. You do not need to use the Release service if you use this configuration.

Note: The Sterling B2B Integrator BPML validation check on business process models will report an error for improper document loop configuration. However, if you are using business process models configured with this document loop that pre-date the validation check, and you have not checked the process models out and back in again, you can continue to run them. Recommended practice, however, is to modify their structure to ensure optimum processing based on the instructions provided here.

Example 1 – Properly Configured BPML

The following example format shows the proper configuration of a business process model that uses method 1:


<process name="BPN_TopScopeWithRelease">
  <sequence name="Begin">
    <sequence name="foreachSplitDoc">
      <operation name="For Each Document">
        <participant name="ForEachDocument"/>
        <output message="ForEachDocumentTypeInputMessage">
          <assign to="." from="*"></assign>
        </output>
        <input message="inmsg">
          <assign to="." from="*"></assign>
        </input>
      </operation>

      <assign name="Assign" to="message_to_child" from="PrimaryDocument"></assign>
      <operation name="Invoke Business Process Service">
        <participant name="InvokeBusinessProcessService"/>
        <output message="InvokeBusinessProcessServiceTypeInputMessage">
          <assign to="." from="*"></assign>
        </output>
        <input message="inmsg">
          <assign to="." from="*"></assign>
        </input>
      </operation>

      <operation name="release">
        <participant name="ReleaseService"/>
        <output message="Xout">
          <assign to="TARGET" from="string('message_to_child')"/>
        </output>
        <input message="Xin"/>
      </operation>

      <repeat name="repeater" ref="foreachSplitDoc"/>

    </sequence>
  </sequence>
</process>

Example 2 – Improperly Configured BPML

The following example shows a format that will fail validation:


process name="BPN_TopScopeNoRelease">
  <sequence name="Begin">
    <sequence name="foreachSplitDoc">
      <operation name="For Each Document">
        <participant name="ForEachDocument"/>
        <output message="ForEachDocumentTypeInputMessage">
          <assign to="." from="*"></assign>
        </output>
        <input message="inmsg">
          <assign to="." from="*"></assign>
        </input>
      </operation>

      <assign name="Assign" to="message_to_child" from="PrimaryDocument"></assign>
      <operation name="Invoke Business Process Service">
        <participant name="InvokeBusinessProcessService"/>
        <output message="InvokeBusinessProcessServiceTypeInputMessage">
          <assign to="." from="*"></assign>
        </output>
        <input message="inmsg">
          <assign to="." from="*"></assign>
        </input>
      </operation>

      <repeat name="repeater" ref="foreachSplitDoc"/>

    </sequence>
  </sequence>
</process>