Handling Exceptions
When the queue schedule dictates, the wm.tn.queuing:deliverBatch service is invoked. The wm.tn.queuing:deliverBatch built-in service, in turn, invokes your scheduled delivery service and passes your service information about the queue.
This wm.tn.queuing:deliverBatch service catches any exceptions thrown by your scheduled delivery service or the underlying transport service that your services uses to deliver the document. In response to an exception, the wm.tn.queuing:deliverBatch service increments the retry count for the current delivery task and logs the exception to the activity log.
If your scheduled delivery service needs to take action in response to an exception, use the pub.flow:getLastError service to detect whether an exception was thrown.
If you are creating your scheduled delivery service using the flow language, and you want to exit your scheduled delivery service due to a failure, use the following flow operation:
EXIT $flow and signal FAILURE
The above flow operation causes the wm.tn.queuing:deliverBatch service to increment the current delivery task’s retry count and log the exception to the activity log. You provide the information that Trading Networks logs to the activity log. To provide this information, be sure you specify meaningful information in:
The failure-message property of the EXIT flow operation.
The
logMsg variable in Pipeline out; map meaningful text to this variable.