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] outputting variables
Date Wed, 12 Apr 2006 16:10:40 GMT
On 4/12/06, Mike Sparr - www.goomzee.com <mike@goomzee.com> 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???
>
<snip/>

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
example:
   - 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
purpose).

Not saying you should do either, just some ideas.

-Rahul

<snip-scxml-snippets/>

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


Mime
View raw message