Workflow: Create Originating Transaction with Correlation Information

In this scenario, you create a custom originating transaction and the correlation header that a downstream transaction will need to correlate with it.
  1. Start a custom transaction:
    var trx=appd.startTransaction(...)
  2. 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).
  3. Create correlation information from the exit call:
    c=trx.createCorrelationInfo(e)
  4. Store the correlation information.
  5. Make the exit call.
  6. 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.
  7. If you created a custom exit call, end the exit call after you have processed the exit call response:
    trx.endExitCall(e)
  8. End the transaction:
    trx.end()