commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dario D <>
Subject [scxml] Handling condition errors in transitions
Date Mon, 12 Sep 2011 09:17:25 GMT

I have an SCXML workflow as given below. The conditions in the transitions
of "state2" are invalid because they have an invalid variable name
"trans-0". The application was made in the way that on each step forward, it
triggers an "" event, followed by any external events inserted by
a custom ErrorReporter. This way, the workflow would move to the "_error"
state on every error. The problem is that on parsing of "state2" transition
conditions, it did not move to "_error" state. The following sequence

1) Workflow follows to "state2"
2) Current state is "state2", application triggers an "" event
3) ErrorReported inserted two "action.error" events in the queue
4) However, the workflow is already in "_end" state (why?)
5) Application reads the external events queue, triggers two "action.error"
events, but nothing happens because workflow is in "_end" state

Why workflow ends up in "_end" state after parsing error?

*<scxml xmlns="***<>
*    <state id="_start">
        <transition target="_processing" />
*    <state id="_processing">*
*        <initial>
            <transition target="_actions"/>
*        <history id="_history" type="deep">*
*        </history>

        <state id="_actions" initial="state1">
            <state id="state1">
                <transition event="" target="state2" />
*            <state id="state2">
                <transition event=""
cond="trans-0.parameter.P_InitialBalance == 7" target="state3" />
                <transition event=""
cond="trans-0.parameter.P_InitialBalance == 0" target="state4" />
*            <state id="state3">
                <transition event="" target="state5" />
*            <state id="state4">
                <transition event="" target="state5" />
*            <state id="state5">
*        <transition event="" target="_end" />*
*        <transition event="action.end" target="_end"/>*
*        <transition event="error.*" target="_error" />*
*    </state>*
*    <state id="_error">*
*        <onentry>
            <log expr="'In error'"/>
*        <transition event="" target="_history"/>*
*        <transition event="action.end" target="_end"/>*
*    </state>*
*    <state id="_end" final="true">*
*    </state>*

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message