EXIT step with a blank bfromb field

The Developers guide does not tell us what a blank ‘from’ field does, but it doesn’t cause a runtime error and it does seems to exit the containing service - but - it always seems to signal failure.

For example:

service exitTestCaller: Run this to test.
A: SEQ ex-on SUCCESS
|-B: SEQ ex-on FAILURE
|–exitTest
|–M1:MAP status = success // Not executed
|-M2: MAP status = failure // after exitTest, comes here.

service exitTest:
C: SEQ ex-on SUCCESS
|-D: SEQ ex-on FAILURE
|–exit from signal success
|–M3:MAP status = somethingToDo // Not executed
|-M4: MAP status = somethingToDo // Not executed
M5: MAP status = somethingToDo // Not executed

When I step through this, the exit leaves exitTest (without running M3, M4, or M5) and then runs M2, setting status to failure. exitTest has returned to sequence B, and if it had signalled success, it should have continued sequence B and run M1, signalling success. SeqB is an exit on failure, and this is not a failure, so should keep going. When seqB completes without failure, it should signal SUCCESS. Sequence A exits on success, so it should not run M2. But it does.

Therefore the I must have done something wrong, but I don’t know what it is. Perhaps you can see it?

In M2 call pub.flow:getLastError. That will tell you what error last occurred. I’m reasonably certain that the blank from on your exit statement is indeed throwing an error. Change your exit statement to exit from $flow and you’ll get the results you expect.