Hello,
My flow service has the following structure:
global: Sequence (exit on SUCCESS)
try: Sequence (exit on FAILURE)
catch: Sequence (exit on DONE)
In the “catch” sequence, I need to know how I got there. Right now I want to declare a “flag” variable that I would change in the “try” sequence.
If I get to the “catch” sequence, I want to get the value of this “flag” so I can decide if I want to crash the service or not.
My problem is that I don’t know how to send data from the “try” to the “catch”: when I get to the catch I get the same pipeline I had at the beginning of the try sequence!
I can’t use “getLastError” because the error may have been already sent
Do you have any solution?
If I define the variable outside of my global sequence, when I get to the catch it will be set to the value it had at the beginning of the TRY sequence, therefore any modification I make after that is useless.
I had forgotten that the pipeline was available in the lastError/pipeline, thank you!
I had a similar problem. The solution found was to use a document (structure) and place the variable inside the document. And, as it was already said, we initialized the variable before the Try sequence.
(Hope this helps someone, although the original post has more than a year already).
Yes, declaring the variable within a document and then setting it to a pre-defined value before the TRY block is a way of getting the changes performed to the value of the above variable (within TRY block) reflected in the CATCH block.