commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rahul Akolkar" <>
Subject Re: [SCXML] Parallel States
Date Mon, 08 May 2006 20:44:43 GMT
On 5/7/06, Fasih <> wrote:
> Hello ppl
> I am trying to create a state with external source, but stargely enough, the state machine
enters the state "automatically". my xml:
> <scxml
>  xmlns=""
>  initialstate="setup-call">
>    <state id="setup-call">
>        <parallel id="ivr-interaction">
>          <state id="orig-leg"/>
>          <state id="ivr-leg">
>            <initial>
>              <transition target="external-ivr"/>
>            </initial>
>            <state id="external-ivr" src="external-hello.scxml"/>
>          </state>
>        </parallel>
>    </state>
>    <state id="hungup" src="external-hello.scxml"/>
> </scxml>
> external-hello.scxml
> <scxml
>  xmlns=""
>  version="1.0"
>  initialstate="wait-for-ivr-request">
>  <state id="wait-for-ivr-request"/>
> </scxml>
> Results in:
> [main] WARN org.apache.commons.scxml.env.SimpleErrorReporter - ILLEGAL_CONFIG (Not all
AND states active for parallel ivr-interaction): /setup-call/ivr-interaction : [/setup-call/ivr-interaction/orig-leg]
> [main] WARN org.apache.commons.scxml.env.SimpleErrorReporter - ILLEGAL_CONFIG (Multiple
top-level OR states active!): <SCXML> : [/setup-call, /hungup]
> Any clues as to what is wrong in this????

Including external-hello.scxml twice in the parent document gave us
two states with ID "wait-for-ivr-request". Since the transition target
for the <initial> in "ivr-leg" is really meant to be an IDREF, that
throws the engine off.

What you're trying to do is a perfectly valid usecase. This is
sometimes referred to as "state templating", and the preferred way to
achieve this is to therefore use some templating technology (be it a
JSP that produces SCXML, or a Velocity template, or something else).
For example:

<scxml ... >

  <state id="foo1" src="">
    <!-- possibly something here -->

  <state id="foo2" src="">
    <!-- possibly something (else) here -->


And the param gets woven into the IDs and other relevant bits of the
generated SCXML snippet (to eliminate duplicate IDs, for one).

As an aside, this is not related to parallelism, other than <parallel>
just happens to be present in this particular example.


> Any help greatly appreciated
> +Fasih

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

View raw message