Workflow: Create Continuing Transaction Correlated with Upstream and Downstream Transactions

In this scenario, you create a continuing transaction that needs to correlate both with an upstream originating transaction and a downstream transaction. It uses the correlation techniques described in both of the previous workflows.

  1. Retrieve correlation information stored by the previous transaction.
  2. Parse the retrieved correlation information into a correlation header:
    ch=appd.parseCorrelationInfo(c1)
  3. Start a custom transaction using the correlation header:
    trx=appd.startTransaction(ch)
  4. Either start a custom exit call using e= trx.startExitCall(einfo), or capture a detected exit call by installing a callback function to e= trx.beforeExitCall(e).
  5. Create correlation information from the exit call in this transaction:
    c2=trx.createCorrelationInfo(e)
  6. Store the correlation information for the next downstream transaction.
  7. Make the exit call.
  8. Optional: Provide a trx.exitCallCompleted(e) callback function, if you want to modify what is reported to the controller based on information obtained from the execution of the exit call.
  9. If you created a custom exit call, end the exit call after you have processed the exit call response:
    trx.endExitCall(e)
  10. End the transaction:
    trx.end()