commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rahul Akolkar" <>
Subject Re: [SCXML] outputting variables
Date Wed, 12 Apr 2006 16:10:40 GMT
On 4/12/06, Mike Sparr - <> wrote:
> Do variables need to be added to the namelist for display within output?
> Strange thing is when sending SOAP message with ${var_name} it captures the
> value of that variable and sends in SOAP message.  When attempting to
> display variables in another transition event (e.g. Confirmation), it
> outputs the literal ${var_name} instead of the value???

The body of the <send> content is *not* any kind of template i.e.
there is no variable substitution. If you're seeing it happen, there
are other factors affecting that particular usage (not listed here).

You can however use any templating method (using the namelist as the
"context") by wiring up the EventDispatcher appropriately. A couple of
unrelated comments based on the code snippets:

 * If you want to separate the view layer markup, such as the VoiceXML
snippet, have the EventDispatcher look up the snippet (send it a
"snippetID" or some such via the namelist and do a lookup).

 * If you want to further leverage the targettype attribute you can
cater to multiple view layer / service layer technologies, for
   - A targettype "x-velocity" may lookup a Velocity template and
populate the VelocityContext with the namelist data
   - A targettype "x-jsp" may send the output rendered by a JSP to the
client, similarly populating the request data
   - A targettype "x-webservice" may make a webservices call
   - A targettype "x-soap" may issue a SOAP request

(the x- prefix indicates non-standard i.e. part of your custom solution).

And that probably gets you the simplest instance of a MVC / Model 2
web architecture using Commons SCXML (for the controller bit and
possibly the model as well if you use <datamodel> exclusively for that

Not saying you should do either, just some ideas.



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

View raw message