You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Hallvard Trætteberg <ha...@idi.ntnu.no> on 2006/08/17 17:09:27 UTC
[scxml] support for pnuts as expression language
Hi,
In my PhD thesis I developed a UI dialog modelling language, which uses
statecharts for controlling activation/deactivation of user interface
elements. I'm now in the process of implementing the runtime based on
Apache's SCXML library. It's great to have such a nicely architected package
to work with.
For other parts of the system I use the pnuts scripting language, and
therefore I've implemented support for using pnuts as SCXML's expression
language (instead of EL). BTW, I also use pnuts for scripting within XSWT,
which is used to define the SWT widget hierarchy (the tool is hosted by
Eclipse, hence SWT instead of Swing). It was fairly easy, once I understood
how scoping works! If anyone's interested, I'll be glad to share the code.
The implementation defines a custom Context implementation, and for
debugging purposes I've found it useful to generate a name. Then I thought
that I ideally would like access to the containing state's name (id). Would
it be possible to pass this String as a first argument to
Context.newContext() or somehow make it possible to get hold of it? For
pnuts this gives an extra benefit: I map contexts to pnuts packages, which
are named and may be access using a prefix. Hence, with such names, it would
be possible to refer to other Contexts, making each one look more like a
named object with properties.
Hallvard
---
Hallvard Trætteberg (hal@idi.ntnu.no, http://www.idi.ntnu.no/~hal)
Associate Professor, IS group, Dept. of Computer and Information Sciences at
the Norwegian Univ. of Science and Technology
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org
Re: [scxml] support for pnuts as expression language
Posted by Rahul Akolkar <ra...@gmail.com>.
On 8/17/06, Hallvard Trætteberg <ha...@idi.ntnu.no> wrote:
> Hi,
>
> In my PhD thesis I developed a UI dialog modelling language, which uses
> statecharts for controlling activation/deactivation of user interface
> elements. I'm now in the process of implementing the runtime based on
> Apache's SCXML library. It's great to have such a nicely architected package
> to work with.
>
> For other parts of the system I use the pnuts scripting language, and
> therefore I've implemented support for using pnuts as SCXML's expression
> language (instead of EL). BTW, I also use pnuts for scripting within XSWT,
> which is used to define the SWT widget hierarchy (the tool is hosted by
> Eclipse, hence SWT instead of Swing). It was fairly easy, once I understood
> how scoping works! If anyone's interested, I'll be glad to share the code.
>
<snip/>
Sounds good, I'm definitely interested (especially by the SWT connection).
If you want to make the code available for others, you can file a new
JIRA ticket (the category will probably be "Wish") and attach a diff
there. You'll need to sign up with JIRA, all the details are here:
http://jakarta.apache.org/commons/scxml/issue-tracking.html
There are two things to note (if you're already aware how the ASF
works with contributions, feel free to skip this):
1) License compatibility. I think the pnuts license (SPL 1.0) is
usable for our libraries (as a dependency). Any new file must come
with a ASLv2 header (look at any other Commons SCXML source file).
2) Depending on the size of the contribution, we may ask for a
Individual Contributor License Agreement before the code is accepted
into the Apache SVN repository. The ICLA is here:
http://www.apache.org/licenses/icla.txt
Would you be willing to file an ICLA?
Let us know if you have any questions.
> The implementation defines a custom Context implementation, and for
> debugging purposes I've found it useful to generate a name. Then I thought
> that I ideally would like access to the containing state's name (id). Would
> it be possible to pass this String as a first argument to
> Context.newContext() or somehow make it possible to get hold of it? For
> pnuts this gives an extra benefit: I map contexts to pnuts packages, which
> are named and may be access using a prefix. Hence, with such names, it would
> be possible to refer to other Contexts, making each one look more like a
> named object with properties.
>
<snap/>
Makes sense, in fact the W3C Working Draft now requires us to be able
to identify a Context by using the state ID, so this will probably be
part of the next release (no date on that yet, but it will be a few
months). To elaborate, for:
<state id="foo">
<onentry>
<var name="bar" ... />
</onentry>
...
you will be able to automagically use "foo.bar" in an expression
anywhere in the document (not just in executable content in state foo)
to point to the bar variable in foo's Context. Probably the easiest
way that will work in most ELs is to provide a Map adapter for each
Context in the root context of the SCXMLExecutor. Its harder to change
the method you mention above (since its part of the "public" interface
of the SCXML component and will require a major release -- next major
release will be 1.0), but if you have any ideas/suggestions, feel free
to post them (probably on the dev list).
-Rahul
> Hallvard
>
> ---
> Hallvard Trætteberg (hal@idi.ntnu.no, http://www.idi.ntnu.no/~hal)
> Associate Professor, IS group, Dept. of Computer and Information Sciences at
> the Norwegian Univ. of Science and Technology
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org