I have a little doubt that even after a deep research I still not able to use the “EXIT” flow step.
I have the following situation flow situation:
Try:
Another flow service that returns IFRESULT = “E” or IFRESULT = “Z” with an “IFMESSAGE” variable
Branch on “/IFRESULT”:
E:
EXIT from $parent and signal FAILURE
Z:
<== Do something else ==>
Catch:
pub.flow.getLastErrorFromPipeline
<== Exception Handling steps here ==>
IIRC if you do an EXIT (with a message) from a sequence and then jump into another sequence within the same flow and do “getLastError” there, you won’t get the error mesage as part of the error object. This is a known behaviour (admittedly not very intuitive).
You have to write the service in such a way (pay attention to sequence “scopes”!) that the message text is still available in the catch block.
I managed to develop what I wanted by creating a second service and invoking it. Inside of this new created service, I put the following steps:
Another flow service that returns IFRESULT = “E” or IFRESULT = “Z” with an “IFMESSAGE” variable
Branch on "/IFRESULT
E:
==> EXIT from $flow and signal FAILURE
Z:
<== Do something else ==>
After doing this I’m now able to get the “IFMESSAGE” value via the “getLastError” in the first service.