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

RE: preemption again (sigh...)

From: Michael Bodell <bodell@247-inc.com>
Date: Thu, 28 Feb 2013 22:03:13 +0000
To: Jim Barnett <Jim.Barnett@genesyslab.com>, "VBWG Public (www-voice@w3.org)" <www-voice@w3.org>
Message-ID: <99155A875ACA0F41BDE9B4DA3E307426119BB256@HKNPRD0310MB350.apcprd03.prod.outlook.com>
I personally find the current behavior more intuitive, where the transition associated with deeplyNested1 that goes to somewhereFarAway "wins" over the transition as part of deeplyNested2.  I think the key thing for me is which atomic states you are in at the time, so thinking from that perspective makes the current behavior intuitive.

From: Jim Barnett [mailto:Jim.Barnett@genesyslab.com]
Sent: Thursday, February 28, 2013 1:57 PM
To: VBWG Public (www-voice@w3.org)
Subject: preemption again (sigh...)

Johan points out that the currently proposed definition of preemption (and the one in the current spec) have a counter-intuitive result, which is that transitions placed very high in the state machine can preempt ones in atomic states.  Consider the following case:

<state id="s1">
<transition event="e" target="someWhereFarAway">
    ... imagine a bunch of nested states here with no transitions that handle e...
   <parallel>
      <state id="deeplyNested1"/>
      <state id="deeplyNested2">
           <transition event="e" target="someWhereElseFarAway"/>
  </state>
</parallel>
.......
</state>

If we are within the parallel region when e occurs, then state deeplyNested1 will select the transition that is a child of s1 while deeplyNested2 will select the transition that is contained inside it.   These two transitions will conflict.  In our current definition, the one chosen by deeplyNested1 will win, since that state comes first in document order.   Johan finds this counterintuitive since that transition is located much higher up in the state machine than the one in deeplyNested2.  (In fact, its source state is an ancestor of deeplyNested2).    Johan argues that this will make the behavior of complex state machines hard to understand.

So, my question is:  do other people find this behavior odd or confusing?  Do we want to try to tweak the definition so that the transition in deeplyNested2 would win?  (It may take a pretty big tweak...)


-          Jim


P.S.  I've looked at UML 2 and find its explanation extremely vague.  It does define clearly conflict in terms of intersecting exit sets.  It also says that transitions inside descendents take precedence over transitions in ancestors, but the rest of the discussion is so confusing that I'm not sure what algorithm they really suggest.
Received on Thursday, 28 February 2013 22:03:46 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Thursday, 28 February 2013 22:03:50 GMT