You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Enrico Nardelli <na...@mat.uniroma2.it> on 2011/06/03 09:20:19 UTC
[scxml] transition leaving a child state of parallel
I have the following SCXML
<?xml version="1.0" encoding="UTF-8"?>
<scxml xmlns="http://www.w3.org/2005/07/scxml" version="1.0" exmode="lax"
initialstate="initialstate">
<state id="initialstate">
<transition event="start" target="onetwo" />
</state>
<parallel id="onetwo">
<transition event="onetwo_three" target="three" />
<state id="one">
</state>
<state id="two">
<transition event="two_four" target="four" />
</state>
</parallel>
<state id="three">
<transition event="three_one" target="one" />
<transition event="three_four" target="four" />
</state>
<state id="four">
<transition event="four_onetwo" target="onetwo" />
<transition event="four_three" target="three" />
</state>
</scxml>
Issuing event "onetwo_three" while in the parallel correctly brings the
state machine in "three".
Issuing event "two_four" while in the parallel raises an ILLEGAL_CONFIG
error.
Here is the detailed log transcription
3-giu-2011 3.30.35 org.apache.commons.scxml.model.Log execute
INFO: null: entering initialstate
event: start
3-giu-2011 3.30.46 org.apache.commons.scxml.model.Log execute
INFO: null: leaving initialstate
3-giu-2011 3.30.46 org.apache.commons.scxml.model.Log execute
INFO: null: entering onetwo
3-giu-2011 3.30.46 org.apache.commons.scxml.model.Log execute
INFO: null: entering one
3-giu-2011 3.30.46 org.apache.commons.scxml.model.Log execute
INFO: null: entering two
event: onetwo_three
3-giu-2011 3.30.53 org.apache.commons.scxml.model.Log execute
INFO: null: leaving two
3-giu-2011 3.30.53 org.apache.commons.scxml.model.Log execute
INFO: null: leaving one
3-giu-2011 3.30.53 org.apache.commons.scxml.model.Log execute
INFO: null: leaving onetwo
3-giu-2011 3.30.53 org.apache.commons.scxml.model.Log execute
INFO: null: entering three
event: three_four
3-giu-2011 3.31.04 org.apache.commons.scxml.model.Log execute
INFO: null: leaving three
3-giu-2011 3.31.04 org.apache.commons.scxml.model.Log execute
INFO: null: entering four
event: four_onetwo
3-giu-2011 3.31.08 org.apache.commons.scxml.model.Log execute
INFO: null: leaving four
3-giu-2011 3.31.08 org.apache.commons.scxml.model.Log execute
INFO: null: entering onetwo
3-giu-2011 3.31.08 org.apache.commons.scxml.model.Log execute
INFO: null: entering one
3-giu-2011 3.31.08 org.apache.commons.scxml.model.Log execute
INFO: null: entering two
event: two_four
3-giu-2011 3.31.15 org.apache.commons.scxml.env.SimpleErrorReporter onError
AVVERTENZA: ILLEGAL_CONFIG (Not all AND states active for parallel onetwo):
/onetwo : [/onetwo/one]
Illegal state machine configuration!
3-giu-2011 3.31.15 org.apache.commons.scxml.env.SimpleErrorReporter onError
AVVERTENZA: ILLEGAL_CONFIG (Multiple top-level OR states active!): <SCXML> :
[/four, /onetwo]
Any hints ?
Best...Enrico
--
View this message in context: http://apache-commons.680414.n4.nabble.com/scxml-transition-leaving-a-child-state-of-parallel-tp3570162p3570162.html
Sent from the Commons - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org
Re: [scxml] transition leaving a child state of parallel
Posted by Rahul Akolkar <ra...@gmail.com>.
On Mon, Jun 6, 2011 at 4:24 PM, Enrico Nardelli
<na...@mat.uniroma2.it> wrote:
>
> Rahul Akolkar wrote:
>>
>> I can't see why it should error out either. Please open a defect in
>> JIRA [1] with above SCXML document and I'll take a look.
>
> I opened it
> https://issues.apache.org/jira/browse/SCXML-161
>
<snip/>
Thanks, I've checked in a fix, which you may verify by building [A]
from source. More on providing test cases below.
>
> Rahul Akolkar wrote:
>>
>> If you're so inclined, a patch with a (failing) JUnit test -- see
>> existing test suite [2] for inspiration -- would make it even easier.
>>
>> -Rahul
>>
>> [1] http://commons.apache.org/scxml/issue-tracking.html
>> [2]
>> http://svn.apache.org/repos/asf/commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml/
>>
>
> I would be glad to contribute more,
<snap/>
Excellent :-)
> but I am not sure whether I'll be able
> to do what you are suggesting. I know very little about JUnit...
>
> If I've undertstood well I should upload under the directory in reference
> [2], probably in subdirectory model, a file called e.g
> ParallelTest<something>.java and corresponding file parallel<something>.xml.
> The first file containing a JUnit test case having in input the second file
> and failing.
>
> Is that correct?
>
<snip/>
Yes, the outline is correct, though you'd attach a patch in JIRA
rather than upload anything. More on creating and submitting patches
here [B].
By way of example, you may look at r1132819 [C], in which I've checked
in a fix for this issue. To start, I took the test case you provided
(added as new file transitions-05.xml) and added a JUnit test (see
text changed for SCXMLExecutorTest.java -- I added the test to
existing file rather than creating a new one, but one could've created
ParallelTest<something>.java as you mention instead). The JUnit test
is actually quite easy to write since we have a number of test utility
functions to help. As you can see, it was basically 6-7 lines of
simple Java code based on your description. The test failed as you
indicated, then I made a fix to the source locally so it passed, and
checked in the fix as well (see change in SCXMLHelper.java). A good
failing test case illustrating the bug is usually halfway to fixing
it, so bug reporters can help with such patches (with or without
actual fixes themselves).
Please let me know if any of the above needs more clarification.
-Rahul
[A] http://commons.apache.org/scxml/building.html
[B] http://commons.apache.org/patches.html
[C] http://svn.apache.org/viewvc?view=revision&revision=1132819
> - Enrico
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org
Re: [scxml] transition leaving a child state of parallel
Posted by Enrico Nardelli <na...@mat.uniroma2.it>.
Rahul Akolkar wrote:
>
> I can't see why it should error out either. Please open a defect in
> JIRA [1] with above SCXML document and I'll take a look.
>
I opened it
https://issues.apache.org/jira/browse/SCXML-161
Rahul Akolkar wrote:
>
> If you're so inclined, a patch with a (failing) JUnit test -- see
> existing test suite [2] for inspiration -- would make it even easier.
>
> -Rahul
>
> [1] http://commons.apache.org/scxml/issue-tracking.html
> [2]
> http://svn.apache.org/repos/asf/commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml/
>
I would be glad to contribute more, but I am not sure whether I'll be able
to do what you are suggesting. I know very little about JUnit...
If I've undertstood well I should upload under the directory in reference
[2], probably in subdirectory model, a file called e.g
ParallelTest<something>.java and corresponding file parallel<something>.xml.
The first file containing a JUnit test case having in input the second file
and failing.
Is that correct?
- Enrico
--
View this message in context: http://apache-commons.680414.n4.nabble.com/scxml-transition-leaving-a-child-state-of-parallel-tp3570162p3577921.html
Sent from the Commons - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org
Re: [scxml] transition leaving a child state of parallel
Posted by Rahul Akolkar <ra...@gmail.com>.
On Fri, Jun 3, 2011 at 3:20 AM, Enrico Nardelli
<na...@mat.uniroma2.it> wrote:
> I have the following SCXML
>
> <?xml version="1.0" encoding="UTF-8"?>
> <scxml xmlns="http://www.w3.org/2005/07/scxml" version="1.0" exmode="lax"
> initialstate="initialstate">
> <state id="initialstate">
> <transition event="start" target="onetwo" />
> </state>
> <parallel id="onetwo">
> <transition event="onetwo_three" target="three" />
> <state id="one">
> </state>
> <state id="two">
> <transition event="two_four" target="four" />
> </state>
> </parallel>
> <state id="three">
> <transition event="three_one" target="one" />
> <transition event="three_four" target="four" />
> </state>
> <state id="four">
> <transition event="four_onetwo" target="onetwo" />
> <transition event="four_three" target="three" />
> </state>
> </scxml>
>
> Issuing event "onetwo_three" while in the parallel correctly brings the
> state machine in "three".
>
> Issuing event "two_four" while in the parallel raises an ILLEGAL_CONFIG
> error.
>
<snip/>
I can't see why it should error out either. Please open a defect in
JIRA [1] with above SCXML document and I'll take a look.
If you're so inclined, a patch with a (failing) JUnit test -- see
existing test suite [2] for inspiration -- would make it even easier.
-Rahul
[1] http://commons.apache.org/scxml/issue-tracking.html
[2] http://svn.apache.org/repos/asf/commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml/
> Here is the detailed log transcription
>
> 3-giu-2011 3.30.35 org.apache.commons.scxml.model.Log execute
> INFO: null: entering initialstate
>
> event: start
> 3-giu-2011 3.30.46 org.apache.commons.scxml.model.Log execute
> INFO: null: leaving initialstate
> 3-giu-2011 3.30.46 org.apache.commons.scxml.model.Log execute
> INFO: null: entering onetwo
> 3-giu-2011 3.30.46 org.apache.commons.scxml.model.Log execute
> INFO: null: entering one
> 3-giu-2011 3.30.46 org.apache.commons.scxml.model.Log execute
> INFO: null: entering two
>
> event: onetwo_three
> 3-giu-2011 3.30.53 org.apache.commons.scxml.model.Log execute
> INFO: null: leaving two
> 3-giu-2011 3.30.53 org.apache.commons.scxml.model.Log execute
> INFO: null: leaving one
> 3-giu-2011 3.30.53 org.apache.commons.scxml.model.Log execute
> INFO: null: leaving onetwo
> 3-giu-2011 3.30.53 org.apache.commons.scxml.model.Log execute
> INFO: null: entering three
>
> event: three_four
> 3-giu-2011 3.31.04 org.apache.commons.scxml.model.Log execute
> INFO: null: leaving three
> 3-giu-2011 3.31.04 org.apache.commons.scxml.model.Log execute
> INFO: null: entering four
>
> event: four_onetwo
> 3-giu-2011 3.31.08 org.apache.commons.scxml.model.Log execute
> INFO: null: leaving four
> 3-giu-2011 3.31.08 org.apache.commons.scxml.model.Log execute
> INFO: null: entering onetwo
> 3-giu-2011 3.31.08 org.apache.commons.scxml.model.Log execute
> INFO: null: entering one
> 3-giu-2011 3.31.08 org.apache.commons.scxml.model.Log execute
> INFO: null: entering two
>
> event: two_four
> 3-giu-2011 3.31.15 org.apache.commons.scxml.env.SimpleErrorReporter onError
> AVVERTENZA: ILLEGAL_CONFIG (Not all AND states active for parallel onetwo):
> /onetwo : [/onetwo/one]
> Illegal state machine configuration!
> 3-giu-2011 3.31.15 org.apache.commons.scxml.env.SimpleErrorReporter onError
> AVVERTENZA: ILLEGAL_CONFIG (Multiple top-level OR states active!): <SCXML> :
> [/four, /onetwo]
>
> Any hints ?
>
> Best...Enrico
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org