SCXML Test 354 uses datamodel-specific <content>?

test179.txml has:
	<send event="event1"><content>123</content></send>
	<transition … conf:eventdataVal="123” … />

My data model evaluates the text content of <content> as code, so that <content expr=“123”/> is the same as <content>123</content>, and my transformation of the tests converts the condition above to <transition cond=“_event.data.val==123” … />.

However, test354.txml has this:
	<send  event="event2"><content>foo</content></send>
	<transition … conf:eventdataVal="'foo'” … />
(notice the single quotes around the ‘foo’ inside the double-quotes).

This breaks my data model, since evaluating foo as a Lua expression results in nil, not the string ‘foo’. If I switch my data model to interpret the text child of <content> as a string instead, then test 179 would fail.


I can modify this test to change to <content>’foo’</content>, but I think this is too specific to ECMAScript and Lua data models. I would suggest that at a minimum this test should match the pattern from test179. However, ideally, I am afraid that more conf: is really needed here, to be properly generic for data models.

Received on Thursday, 19 June 2014 13:28:07 UTC