Handling the iProcess Action Processor response message
Facts - Tibco
Thursday, 27 December 2012 22:41

This note is for Tibco iProcess 11 and Tibco BusinessWorks 5.6 but applies to many other versions as well.

I tried to release an iProcess Work Item by calling the iProcess Action Processor from Tibco BusinessWorks. When the release failed I had to rollback some changes in the database. So I had to test the output of the Action Processor to check whether the Work Item release went OK. My initial assumption was that the Action Processor would send back a zero return code upon each successful release. See the field Status/ReturnCode in the output message of the Action Processor below:

<ap:ActionResult xmlns:SOAP-ENV = "http://schemas.xmlsoap.org/soap/envelope/" 
  xmlns:ap = "http://tibco.com/bpm/actionprocessor">
  <ap:Status>
    <ap:Version>11.4.0</ap:Version>
    <ap:ReturnCode>0</ap:ReturnCode>
    <ap:ReturnComment>The Action was processed successfully. 
Check the individual Request Results for their status.</ap:ReturnComment>
    <ap:ReturnDateTime>2012-12-27T20:09:25.092+0100</ap:ReturnDateTime>
  </ap:Status>
  <ap:SSO>
    <sso:vSSOData xmlns:sso = "http://tibco.com/bpm/sso/types">
      <sso:Results>
        <sso:vResult Id = "ReleaseItems"/>
      </sso:Results>
    </sso:vSSOData>
  </ap:SSO>
</ap:ActionResult>

From the message above it seemed that testing on the field ReturnCode would be sufficient. Instead it turned out I had to test for the existence of an element SSO/vSSOData/Results/vResult/Exception as well, even if the return code is zero. See the output message below:

<ap:ActionResult 
xmlns:SOAP-ENV = "http://schemas.xmlsoap.org/soap/envelope/" 
xmlns:ap = "http://tibco.com/bpm/actionprocessor">
  <ap:Status>
    <ap:Version>11.4.0</ap:Version>
    <ap:ReturnCode>0</ap:ReturnCode>
    <ap:ReturnComment>The Action was processed successfully. 
Check the individual Request Results for their status.</ap:ReturnComment>
    <ap:ReturnDateTime>2012-12-27T20:13:30.970+0100</ap:ReturnDateTime>
  </ap:Status>
  <ap:SSO>
    <sso:vSSOData xmlns:sso = "http://tibco.com/bpm/sso/types">
      <sso:Results>
        <sso:vResult Id = "ReleaseItems">
          <sso:Exception>
            <sso:ExceptionDetails>
              <sso:vExceptionDetail>
                <sso:ArrayIndex>0</sso:ArrayIndex>
                <sso:ErrorCode>swNoItemErr</sso:ErrorCode>
                <sso:ErrorGroup>swSEOServerException</sso:ErrorGroup>
                <sso:ParameterInfo>staffw_nod|MYPROC|my_participant|R|14215|37732|staffw_nod|MYTASK|0|15</sso:ParameterInfo>
                <sso:Message>Queue item not found.  WorkItem does not exist</sso:Message>
              </sso:vExceptionDetail>
            </sso:ExceptionDetails>
            <sso:ErrorGroup>swParameterException</sso:ErrorGroup>
            <sso:ErrorCode>swItemErrErr</sso:ErrorCode>
          <sso:Message>One of the items in the array returned an error.  </sso:Message>
            <sso:StackTrace/>
          </sso:Exception>
        </sso:vResult>
      </sso:Results>
    </sso:vSSOData>
  </ap:SSO>
</ap:ActionResult>