I assume you’re familiar with startTransaction and commitTransaction/rollbackTransaction services and how they are to be used.
If one structures the service this way:
SEQUENCE (exit on success)
–SEQUENCE (exit on failure)
----startTransaction (returns an ID)
----…
----commitTransaction (accepts ID as input)
–SEQUENCE (exit on done)
----rollbackTransaction (accepts ID as input)
In this case, the ID returned by startTransaction will not be at the “root” level of the pipeline, and rollbackTransaction will not do anything.
There are two approaches that can be used to address this.
-
If one calls getLastError, the ID can be retrieved from the pipeline var in the returned document. This is a relatively non-obvious solution but can be effective.
-
Restructure the service this way:
startTransaction (returns an ID)
SEQUENCE (exit on success)
–SEQUENCE (exit on failure)
----…
----commitTransaction (accepts ID as input)
–SEQUENCE (exit on done)
----rollbackTransaction (accepts ID as input)
In this case, the transaction ID will be in the “root” level of the pipeline and one does not need to get the ID out of the lastError structure.
#Integration-Server-and-ESB#webMethods#Flow-and-Java-services