Dear Wiki user, You have subscribed to a wiki page or wiki category on "Jakarta-commons Wiki" for change notification.
The following page has been changed by RahulAkolkar: http://wiki.apache.org/jakarta-commons/SCXML/Tutorials/History The comment on the change is: Cosmetic changes, 1 minor change (return to history state after error) & credits ------------------------------------------------------------------------------ ## page was renamed from SCXML/Tutorials/History - Remembering State Information - ## page was renamed from SCXML/HomePage/Tutorials/Templating ##language:en - == A tutorial on SCXML History Element == + == A tutorial on SCXML History Element - Remembering State Information == An SCXML with a complex state (A state with substates/parallel elements) can be made to preserve its state information on exit. When a complex state with a ''history'' is entered again, it enters the state it was last in rather than the initial state which it would have otherwise entered. === Use Case === @@ -12, +11 @@ action2-state [act] do action1 on error do error-handling back to action2-state else action3-state [act] do action1 on error do error-handling back to action3-state else - === Example based on the use case above === + === Example based on the use case above (without history) === {{{ <scxml xmlns="http://www.w3.org/2005/07/SCXML" @@ -68, +67 @@ </initial> <transition event="application.error" target="error-handler"/> <history type="deep" id="history-actions"> - <transition target="action-1"/> + <transition target="action-1"/> - </history> + </history> - <state id="action-1"> + <state id="action-1"> - <transition event="action.done" target="action-2"/> + <transition event="action.done" target="action-2"/> - </state> - <state id="action-2"> - <transition event="action.done" target="action-3"/> - </state> - <state id="action-3" final="true"/> </state> + <state id="action-2"> + <transition event="action.done" target="action-3"/> + </state> + <state id="action-3" final="true"/> + </state> - <state id="error-handler"> + <state id="error-handler"> - <transition event="error.handled" target="universe"/> + <transition event="error.handled" target="history-actions"/> - </state> + </state> </scxml> }}} === Explanation === @@ -88, +87 @@ === Source Code === TODO + ---- + + ''Contributed By: Fasihullah Askiri'' + --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
