Hi guys!
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:Code:<subflow-state flow="tools.DoSearch" id="tools.DoSearch"> <attribute-mapper bean="searchType.attributeMapper"/> <transition to="selectSearch.view" on="finish"/> <transition to="error" on="error"/> </subflow-state>
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?Code:<action-state id="retrieveAction"> <action autowire="byType" method="retrieveStudiesFromArchive" class="StudyAction"/> <transition to="overview" on="success"/> <transition to="finish" on="error"/> </action-state> ... <end-state id="finish"/>
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.
Cheers,
Fuad


Reply With Quote