Re: Need to pre-declare SCXML data?

You are correct that the definition of "valid location" depends on the 
data model.  All the spec is trying to do is to define what the 
interpreter should  do if someone assigns to a location that the 
underlying data model won't allow/cannot access.

The prose in test286 is wrong.  conf:invalidLocation="" should be 
converted into whatever counts as an invalid location in your data model.

- Jim
On 4/15/2014 6:54 PM, Gavin Kistner wrote:
> Some of the tests in the SCXML test suite test to ensure that 
> assigning to a data model value location is illegal if there did not 
> pre-exist a <data> element declaring the location. For example, test 
> 286. Is this a limitation of the ECMAScript data model only?
>
> I don't see anywhere in the specs that this is explicitly mentioned. 
> In particular, Section 5.4 on <assign> says only:
>
> "Assignment to a data model is done by using a location expression to 
> denote the part of the data model where the insertion is to be made. 
> If the location expression *does not denote a valid location* in the 
> data model […] the SCXML Processor must place the error 
> 'error.execution' in the internal event queue.”
>
> I cannot find any other definition of what constitutes a "valid 
> location". I assume that it is up to the data model to determine that. 
> For my Lua-based data model, any possible value of the location 
> attribute is a "valid location". I auto-vivify data model locations 
> upon first value creation, be it via either <data> or <assign>.
> Is there a strong reason to require data model locations to be declared with <data> before later <assign>?

-- 
Jim Barnett
Genesys

Received on Wednesday, 16 April 2014 13:37:19 UTC