Add Error Handling to the Business Process

In this sample, shown in BPML, add error handling to the Sterling B2B Integrator business process you created that passes a document to the Connect:Direct Server Adapter (PNODE) which copies the file to the Sterling Connect:Direct® node (SNODE). The error handling ensures that the Sterling Connect:Direct session closes if an error is encountered during the session.

The onFault branch contains an instance of the CD Server End Session Service. If an error occurs after the Begin Session Service, the onFault logic is invoked and the End Session Service terminates the session with the Sterling Connect:Direct server.

Note: To see BPML source code like the example shown below, select View > Source while using the Sterling B2B Integrator Graphical Process Modeler (GPM). To see the business process as depicted in the GPM user interface, select View > Graph.
<process name="CopyToCD">
  <sequence>
    <operation name="File System Adapter">
      <participant name="CollectForCD"/>
      <output message="FileSystemInputMessage">
        <assign to="Action">FS_COLLECT</assign>
        <assign to="filter">daily.txt</assign>
        <assign to="collectionFolder">C:\Collection</assign>
        <assign to="deleteAfterCollect">false</assign>
        <assign to="." from="*"></assign>
      </output>
      <input message="inmsg">
        <assign to="." from="*"></assign>
      </input>
    </operation>
    <operation name="CD Server Begin Session Service">
      <participant name="CDServerBeginSession"/>
      <output message="CDServerBeginSessionServiceTypeInputMessage">
        <assign to="LocalCDNodeName">SI51CD</assign>
        <assign to="RemoteCDNodeName">CDWIN</assign>
        <assign to="RemotePasswd">xxxxxxxx</assign>
        <assign to="RemoteUserId">cduser</assign>
        <assign to="UsingObscuredPasswd">NO</assign>
        <assign to="." from="*"></assign>
      </output>
      <input message="inmsg">
        <assign to="." from="*"></assign>
      </input>
    </operation>
    <sequence>
      <operation name="CD Server CopyTo Service">
        <participant name="CDServerCopyTo"/>
        <output message="CDServerCopyToServiceTypeInputMessage">
          <assign to="RemoteFileName">cd.txt</assign>
          <assign to="SessionToken" from="//BeginSessionResults/SessionToken/node()">
          </assign>
          <assign to="." from="*"></assign>
        </output>
        <input message="inmsg">
          <assign to="." from="*"></assign>
        </input>
      </operation>
      <operation name="CD Server End Session Service">
        <participant name="CDServerEndSession"/>
        <output message="CDServerEndSessionServiceTypeInputMessage">
          <assign to="SessionToken" from="//BeginSessionResults/SessionToken/node()">
          </assign>
          <assign to="." from="*"></assign>
        </output>
        <input message="inmsg">
          <assign to="." from="*"></assign>
        </input>
      </operation>
      <onFault>
        <operation name="CD Server End Session Service">
          <participant name="CDServerEndSession"/>
          <output message="CDServerEndSessionServiceTypeInputMessage">
            <assign to="SessionToken" from="//BeginSessionResults/SessionToken/node()">
            </assign>
            <assign to="." from="*"></assign>
          </output>
          <input message="inmsg">
            <assign to="." from="*"></assign>
          </input>
        </operation>
      </onFault>
    </sequence>
  </sequence>
</process>