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.