commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rahul Akolkar <rahul.akol...@gmail.com>
Subject Re: [scxml] templating/src/xinclude and returning a value(through datamodel/donedata)
Date Thu, 06 May 2010 18:18:57 GMT
On Thu, May 6, 2010 at 1:57 PM, Fabrizio Morbini <fmorbini@gmail.com> wrote:
> On Thu, May 6, 2010 at 10:37, Rahul Akolkar <rahul.akolkar@gmail.com> wrote:
>> Ah, too much cut and paste. Since this assignment isn't necessarily
>> using a location expression, use:
>>
>>  <assign name="AAA" expr="'s3'"/>
>>
>> For details, see:
>>
>>  http://commons.apache.org/scxml/guide/datamodel.html#assign
>>
>> Alternatively, the <data> could be made to store XML content (like the
>> travel reservation example at the above URL), and the location
>> attribute could then be used in a portable way.
>
> using name= instead of location= solves the problem.
>
> however it's not clear to me why it solves the problem (i did read the
> doc page you pointed at). From the doc:
> using name is for: "Assigning to a scratch space variable"
> using location is for "Assigning a literal to a data subtree"
>
<snip/>

A more clear distinction is whether or not the <data> is a atomic
literal (string) or has substructure (such as an XML tree underneath).
The above talks about scratch space variables in the context of
<cs:var> (but is more generally about data items that have no
substructure, which is how the legacy <cs:var> is stored internally as
well).


> our case here is the second, however the one that works is the first.
> If we want to assign to a <data> item that is inherited from a parent
> scxml file, why do we have to use name instead of location?
>
<snap/>

See above.


> finally, what do you mean with your last paragraph? (in particular
> with: "and the location attribute could then be used in a portable
> way", do you mean that there is a way to decouple b.scxml from being
> usable only in a.scxml (or anything providing a <data> item named AAA)
> if the link AAA is implemented as xml as in the reservation example?)
>
<snip/>

In a way. I meant to say the following usage is portable across SCXML
implementations:

  <assign location="..." expr="..."/>

whereas the following is not (though the first WD of SCXML supported
it, and we retain the ability to use it in scenarios mentioned before
for backwards compatibility of Commons SCXML):

  <assign name="..." expr="..."/>

So restructuring the <data> to contain substructure and then using the
former location pattern makes it current practice.

-Rahul


> thanks again.
>
> best,
> fabrizio.
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Mime
View raw message