commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Renaud, Martin" <>
Subject RE: SCXML : can we use ${prop-name-attributes} within <scxml /> definition ?
Date Wed, 05 Aug 2009 19:29:28 GMT
Hi Rahul,

Thanks for answering.

I want to avoid repeating the event name twice, because of the typo risks (among others).

For example, once in the state machine definition:

	<state id="MyState">
        <transition event="core.request.sent"   target="MySecondState"/>

And again in the code:

	public static String EVENT_NAME = "core.request.send";

The names are different (send/sent).

I could easily inject the names in my java code using spring and a property file. EX:

and use the property name ${} where I need in spring files and use some bean
to trigger the events. I would like to know if there is a similar substitution mechanism that
allows me to use to a property file (the same in this case) against my state machine definition.

I understand that I can pre-process the xml document before handing it to scxml, but I wanted
to know if this feature exists or is being plan.



-----Original Message-----
From: Rahul Akolkar [] 
Sent: Wednesday, August 05, 2009 3:05 PM
To: Commons Users List
Subject: Re: SCXML : can we use ${prop-name-attributes} within <scxml /> definition

On Wed, Aug 5, 2009 at 8:37 AM, Renaud, Martin<> wrote:
> Hi,
> I would like to know if it's possible, using a built-in feature of
> apache commons scxml, to use property place holder in the xml file that
> defines the state machine ? The reason is to avoid duplication of event
> names in the sm definition and in the java code ?

Not sure which duplication is being refered to, please elaborate.

> Basically, I would like to do something like this and have a property
> file defining eventA and eventB.

Pre-processing of any sort can be done to the SCXML document before
being handed to the library ofcourse. It seems something like XML
entities may help you here (but I'll need help understanding the
question first).


> <scxml xmlns=""
>       version="1.0"
>       initialstate="reset">
>    <state id="MyState">
>        <transition event="${eventA}"   target="MySecondState"/>
>    </state>
>    <state id="MySecondState">
>        <transition event="${eventB}"    target="MyState"/>
>    </state>
> </scxml>
> Thanks,
> Martin

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

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

View raw message