commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rahul Akolkar" <>
Subject Re: [SCXML] Default Transitions
Date Sat, 08 Apr 2006 17:53:38 GMT
On 4/8/06, Fasih <> wrote:
> Hmm... That src idea was cool. Though I find the superstate concept better.

Sure, its a matter of style, in fact the "superstate" is much
easier/efficient for the parsing bits. The end effect is usually the
same if you squint at it long enough though ;-)

> I can easily do
>   <state id="setup-call">
>    <initial>
>        <transition target="create-call"/>
>     </initial>
>    <state id="create-call">
>     <onentry>
>    <ccxml:createcall dest="accessnumber" name="line1"/>
>   </onentry>
>      <transition event="connection.connected" target="waiting-for-ivr"/>
>    </state>
>    ...
>  <!-- Here, though I would have loved to do a event="*" types of a usage..
> that is, any event not handled by a substate, does not look like that it
> would be possible/-->

There is no elegant construct for this in SCXML. Indeed, it is not
possible to graphically represent this transition in most UML tooling,
nor does such a concept exist in greater state chart theory, AFAIK.
There is no premise that an event *must* cause something to happen,
and it is perfectly acceptable to have an event do nothing to a state
machine's current status (I call these inconsequential events).

In order to get what you need here, there are multiple options (not a
complete list):

 * Complementary conds on transitions (ugly hack, not scalable)

 * Check before and after status of executor while firing events, and
fire an "application.default" event if the trigger is inconsequential
(can do this with current nightlies)

 * We should modify the SCXMLExecutor's triggerEvent() method itself
to offer this feedback, so the tedium of checking the before/after
status will be eliminated. To the effect of:

  boolean inconsequential = exec.triggerEvent(...);
  if (inconsequential) {
  } else {
   //optionally, do something else

 This approach was used here [1], though I never got around to pushing
it into the nightlies.

>   <transition event="connection.failed" target="error"/>
>  </state>
>  <state id="error" final="true">
>  ...
>  </state>
> </scxml>
> Instead of putting a src on each of the state to do the error transition??
> (i.e. If I am not wrong in understanding the concept!)

Lets say we have a state machine defined via a SCXML document
inner.scxml. To add a candidate transition across the board for this
state machine, we would do:


<scxml ... initialstate="inner">

 <state id="inner" src="inner.scxml">
  <transition event="application.error" target="error"/>

 <state id="error" final="true"/>




> +Fasih

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message