Subflow error management and return values.
How should I handle errors in subflows? Let say I catch exception during executing the action in subflow. Should I explicitly define transition to the end-state on="error" in this action state or it is just enough to throw error event without showing transition?
Here are some snippets. In main flow:
and in subflow:
<subflow-state flow="tools.DoSearch" id="tools.DoSearch">
<transition to="selectSearch.view" on="finish"/>
<transition to="error" on="error"/>
In code above I have transition to the end-state on error during action execution in subflow, and in definition of subflow I have transition to the error page if subflow execution finished with error. Is it right or I miss something?
<action autowire="byType" method="retrieveStudiesFromArchive" class="StudyAction"/>
<transition to="overview" on="success"/>
<transition to="finish" on="error"/>
Additionally, I read in docs that subflows can return values. Could you please give some more info about it and some examples?
Thanks a lot in advance.
Webflow: Controlling flow with exceptions
Originally Posted by kdonald
I am suggesting another way of handling recoverable/checked exceptions:
The solution lies in declaring checked exceptions in the flow configuration and declaring mapping that maps typed exceptions to appropriate events. All exception handling then would be only a way of flow configuration and it would take away the burden from developer to do the same exception handling in every action of the controller.
What do you think about this feature?
Thank you, Michal