commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Fasihullah Askiri <fasihullah.ask...@baypackets.com>
Subject Re: [SCXML] Multiple definition of a state's source file
Date Tue, 06 Jun 2006 10:24:16 GMT
Please read:
http://mail-archives.apache.org/mod_mbox/jakarta-commons-user/200605.mbox/%3c001001c67239$fc2d7e20$164b1b0a@prasadsony%3e

<snip>

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="http://foo.bar/baz.scxml?param=1">
    <!-- possibly something here -->
  </state>

  <state id="foo2" src="http://foo.bar/baz.scxml?param=2">
    <!-- possibly something (else) here -->
  </state>

</scxml>

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


</snip>

Heiko.Eichberger@rsbick.rohde-schwarz.com wrote:

>
>
>Hi,
>
>in an SCXML file I've tried to define a source file for states multiple
>times (for sub-states which use the same state machine). The execution of
>it raises a model exception.
>
>06.06.2006 10:47:06 org.apache.commons.scxml.env.SimpleErrorReporter
>onError
>WARNUNG: ILLEGAL_CONFIG (Not all AND states active for parallel 2):
>/state2/2 : [/state2/2/state2_substate1]
>06.06.2006 10:47:06 org.apache.commons.scxml.env.SimpleErrorReporter
>onError
>WARNUNG: ILLEGAL_CONFIG (Not all AND states active for parallel 1):
>/state1/1 : [/state1/1/state1_substate2]
>06.06.2006 10:47:06 org.apache.commons.scxml.env.SimpleErrorReporter
>onError
>WARNUNG: ILLEGAL_CONFIG (Multiple top-level OR states active!): <SCXML> :
>[/state2, /state1]
>org.apache.commons.scxml.model.ModelException: Illegal state machine
>configuration!
>      at
>org.apache.commons.scxml.semantics.SCXMLSemanticsImpl.followTransitions(
>SCXMLSemanticsImpl.java:664)
>      at org.apache.commons.scxml.SCXMLExecutor.triggerEvents(
>SCXMLExecutor.java:113)
>
>But when I copy the source file, rename it and define the copied file at
>state's source definition there are no problems. Here's a sample (state
>"state1" should be entered first):
>
>...
><state id="state1">
>      <parallel id="1">
>            <state id="state1_substate1" src="substate.scxml"/>
>            <state id="state1_substate2">
>                  <transition event="event1" target="state2"/>
>                  <transition event="event2" target="state3"/>
>            </state>
>      </parallel>
></state>
><state id="state2">
>      <parallel id="2">
>            <state id="state2_substate1" src="substate.scxml"/>
>            <state id="state2_substate2">
>                  <transition event="event3" target="state4"/>
>            </state>
>      </parallel>
></state>
>...
>
>Do you hav any hints?
>
>Regards,
>
>Heiko
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: commons-user-help@jakarta.apache.org
>
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message