W3C home > Mailing lists > Public > www-voice@w3.org > January to March 2013

RE: Determining When a Machine is Final

From: Jim Barnett <Jim.Barnett@genesyslab.com>
Date: Tue, 29 Jan 2013 14:08:32 +0000
To: Gavin Kistner <phrogz@me.com>, "www-voice@w3.org" <www-voice@w3.org>
Message-ID: <57A15FAF9E58F841B2B1651FFE16D28101BF39@GENSJZMBX03.msg.int.genesyslab.com>
This is a bug.  I think I know how it crept in, but it will take some thought to fix it correctly. I will open an issue for it.  

- Jim

-----Original Message-----
From: Gavin Kistner [mailto:phrogz@me.com] 
Sent: Monday, January 28, 2013 11:17 PM
To: www-voice@w3.org
Subject: Determining When a Machine is Final

Consider this test case:

    <scxml xmlns="http://www.w3.org/2005/07/scxml" version="1.0" name="HistoryTest">
      <state id="s" initial="s1">
        <state id="s1">
          <onentry><raise event="go"/></onentry>
          <transition event="go" target="pass"/>
        <final id="pass"/>

And this test runner:

    final2 = RXSCy.Machine(@data['final2']).start
    assert(final2.is_active?('pass'),"final2 should pass")
    refute(final2.running?,"final2 should not be running")

In my interpreter, the first assertion works, but the second fails. The state machine enters the 'pass' final state, but the `running` flag is never set to false.

Looking at the algorithm, I don't see where it this case is covered. There are only two spots where running is set to false. The first is when receiving an external cancel event during the mainEventLoop, and the other is at the end of enterStates:

    for s in configuration:
            if isFinalState(s) and isScxmlState(s.parent):
                running = false

1) Is my test case wrong? Should entering the 'pass' final above not kill the interpreter?
2) Or should the above pseudo-code be `if isInFinalState(s) and isScxmlState(s.parent)"`?
Received on Tuesday, 29 January 2013 14:09:00 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:07:43 UTC