Re: Use of fragment in URI to specifi initial state

Le 2 nov 2012 ΰ 00:08, DOLECEK Ales a ιcrit :

>   suppose <invoke type=“http://www.w3.org/TR/scxml/“ src=“http://example/other.xml#s2“/>. The content of the xml source would be:
>  
> <scxml>
>   <state id=“s1“/>
>   <state id=“s2“/>
> </scxml>
>  
> According to current draft the processor should start interpretation by entering s1 via (implicit) initial transition.
>  
> Would not it be usefull to allow start by entering s2 specifed in the frament?
>  
> This would allow to chose the default entry state externally, even if it is not possible to choose multiple parallel states this way.

The main problem I see there is that SCXML sessions are supposed to be black boxes that only communicate with the outside world (even invoked sessions) through events, and it's not terribly difficult to have a transition in your initial state that takes you to an arbitrary state specified by an init event, like this:

<transition event="init" targetexpr="_event.data.id" />

And the transition might be more complex, e.g. to handle more or invalid init data, and a non-SCXML invoked service could accept an init event too.

Also, the URI fragment is not necessarily sent to the server in HTTP requests, which may be an issue if the target is a service running on the server.

			David

Received on Friday, 2 November 2012 07:43:12 UTC