Re: [SCXML] history state in parallel state

>> <scxml>
>> <parallel id="p">
>>     <history id="h">
>>         <transition target="a2"/>
>>     </history>
>>     <state id="a">
>>         <state id="a1"/>
>>         <state id="a2"/>
>>     </state>
>> </parallel>
>> </scxml>
>>

> Ah, thanks! So, in the example above, targeting it explicitly would mean 
> setting the initial state of the scxml to the history state?

I'm not sure what you mean. The initial *configuration* of the document would resolve histories to real states. Remember, there can be no pseudo-states in a configuration. If you did this:

<scxml initial="h">

and added a type="deep" attribute to your <history> (otherwise it can only target immediate siblings)

then the initial configuration would be resolved to (p -> a -> a2) because the history's parent has never been exited, so it has no historical record, so the history's default transition is used instead.

I'm not sure what the behavior should be if you don't specify type="deep". Invalid document? resolve to state 'a' because that's the sibling ancestor of 'a2'?

Note that transitions inside <history> and <initial> are not triggered like normal transitions. Following them does not constitute a microstep. Instead, they resolve (reccursively) to their real targets as if the targets had been the original targets all along.

David

Received on Wednesday, 15 July 2015 08:52:13 UTC