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.
- Retrieve correlation information stored by the previous transaction.
- Parse the retrieved correlation information into a correlation header:
ch=appd.parseCorrelationInfo(c1)
- Start a custom transaction using the correlation header:
trx=appd.startTransaction(ch)
- 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).
- Create correlation information from the exit call in this transaction:
c2=trx.createCorrelationInfo(e)
- Store the correlation information for the next downstream transaction.
- Make the exit call.
- 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.
- If you created a custom exit call, end the exit call after you have processed the exit call response:
trx.endExitCall(e)
- End the transaction:
trx.end()