Re: Transitions between parallel tags.

Thank you for the detailed explanation.

On 27 May 2014 12:30, David Junger <tffy@free.fr> wrote:
> Le 26 maj 2014 à 13:43, c64zottel . <c64zottel@gmail.com> a écrit :
>
>> I am wondering how the following code would work:
>> <parallel>
>> <state id=x>
>>  <state id=e/>
>> </state>
>> <state id=y>
>>  <transition id=t target="e y"/>
>> </state>
>> </parallel>
>>
>> Is that possible? And if, how would it look internally? We have two
>> parallel instances, after transition t, do we have three?
>
> Transitions don't have ids. Ignoring that, the transition in your example would be problematic, not because of what you think, but because it is conditionless and eventless and re-entering its parent, so you end up in an infinite loop.
>
> That being said…
>
> The transition's LCCA is the parallel state's parent (the parallel state itself is the LCA, but not compound), so, when taking the transition, all the substates (e, x and y) will be exited, as well as the parallel state.
>
> Then, the algorithm determines the entry set based on the supplied targets:
> e and y will be added to statesToEnter, in that order:
> - e is added
> -- x is e's parent, so is added too
> --- the parallel state is added, being x's parent
> ---- the parallel state's children are added by default:
> ----- x is already in statesToEnter, so skip that
> ----- y is added
> - y is added explicitly, overriding its default entry
>
> Once the entry set is determined, those states are (re-)entered. The order of entry is not affected by the order in which the ids were written in the target attribute. In fact, you would have gotten the same entry set by specifying "x y", "y x", "y e" or just the id of their parent. In any robust implementation, it is also the case with just "x", "y" or "e", or "x y x e e e"… in your example there is exactly one legal configuration which contains these target sets, so that's the configuration you'll get.
>
> The resulting configuration is identical to what you had before taking the transition and includes all the states (x, e, y and the parallel ancestor).
>
> x is not a parallel state, so, although both x and e are active, only one transition can be eventually selected for that branch. If both e and x had a transition that was enabled in the same context, then e's transition would be selected and prevent the selection of any transition in its parent. In that sense, x and e are not "in parallel".
> x and y are "in parallel", because, after selecting a transition for the x branch, another transition can still be selected for y, and both may be taken at the same time if they do not conflict.
>
>                         David

Received on Sunday, 1 June 2014 13:37:52 UTC