commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rahul Akolkar" <>
Subject Re: [SCXML] variable scoping (was Re: uml2bpel cool, but what about csxml2bpel?)
Date Thu, 06 Apr 2006 16:02:05 GMT
Hi Mike,

Changing the subject, in an attempt to get the mailing list archives
to align things up.

On 4/6/06, Mike Sparr - <> wrote:
> Hey Rahul,
> Do I have to update my version (december snapshot) and implement <datamodel>
> to set global application variables?  I would like to set variables that all
> states/transitions can access and <assign> or cond="${var}".  I got it to
> work by declaring vars WITHIN the transition and passing in namelist for
> SEND..
> See my other post about variable scoping.  Help appreciated.

If you want to declare them at document root, then you will need the
datamodel snapshot (try tonight's build, the 20060406 one, from here
[1]), so you can do this:

<scxml ...>
  <data name="foo" expr="some_expression" />
  <!-- above usage of data is similar to var -->
  <!-- foo is now available to all states/transitions/conds/exprs in
this document -->

See this example [2] that uses EL (as I think you are using) -- its
just a test case (don't try to make sense of the state machine ;-),
but the point being "mainvar" is declared in state "main" and used in
"cond"s in child states as well, illustrating the variable scoping and

If you haven't updated from December, there have been a few changes.
Since you already have a targettype set on the <send> (to "client") I
think you should be fine, but the general deal with sandbox components
is that there are no guarantees while updating between nightlies
(thats in theory, in practice -- if there is trouble, you can always
ping us and we can help resolve any deltas).


(long, possibly fragmented URLs below)


> Rgds,
> Mike

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message