pub.flow:getLastError
WmPublic. Obtains detailed information about the last exception that was trapped within a flow.
An exception is trapped in a flow when a service failure occurs inside a SEQUENCE step that executes until DONE, or when a service failure occurs inside a REPEAT step that repeats on FAILURE.
Input Parameters
None.
Output Parameters
lastError | Document Information about the last error, translated into the language used by the Integration Server. The structure of this document is defined by
pub.event:exceptionInfo. |
Usage Notes
If this service is not invoked from within a flow service, an exception is thrown.
Each execution of a service (whether the service succeeds or fails) updates the value returned by getLastError. Consequently, getLastError itself resets the value of lastError. Therefore, if the results of getLastError will be used as input to subsequent services, map the value of lastError to a variable in the pipeline.
If a map has multiple transformers, then a subsequent call to getLastError will return the error associated with the last failed transformer in the map, even if it is followed by successful transformers.
The pub.flow:getLastError services returns information for failures that originate in a service call made by flow only. The error information is not updated to reflect a failure caused by the EXIT step such as an EXIT step configured to exit $parent and signal failure.
Invoking pub.flow:getLastError repeatedly in a flow service increases the pipeline size as the pipeline/lastError document has the lastError of all previous pub.flow:getLastError executions, which leads to "out of memory" issues in Integration Server when the exceptions are high. In such scenarios, set the watt.server.getLastError.removeLastError server configuration parameter to true, which removes the pipeline/lastError document from the output of the last invocation of the pub.flow:getLastError service.
Note:
This server configuration parameter is introduced for PIE-72767 in IS_10.3_Core_Fix22.
When you invoke pub.flow:getLastError in a flow service and the input to the flow service has non-serializable objects, the pub.flow:getLastError service returns the object type as strings instead of the object reference. For example, consider the following flow service.
In the example, the "SEQUENCE (Try)" step returns a reference to non-serializable objects or object lists of class such as java.io.ByteArraylnputStream. For such non-serializable objects or object lists in the pipeline, when the error occurs, the pub.flow:getlastError service in the "SEQUENCE (Catch)" step returns the object type (java.io.ByteArraylnputStream) as strings instead of the object reference. Therefore, you must initialize the objects outside the "SEQUENCE (Try)" step to make them available to the "SEQUENCE (Catch)" step.