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] variable scoping
Date Thu, 06 Apr 2006 05:41:00 GMT
On 4/5/06, Mike Sparr - www.goomzee.com <mike@goomzee.com> wrote:
> Can someone help with variables?  I want to declare some global variables
> for the xml engine, then have various conditional events set the values of
> those variables.  I would like to have access to those variables from one
> transition event to the next.   I get the following errors:
>
> 09:04:02,372 WARN  [SimpleErrorReporter] UNDEFINED_VARIABLE (fromAccount =
> null):
> 09:04:02,372 WARN  [SimpleErrorReporter] UNDEFINED_VARIABLE (fromAccount =
> null):
> 09:04:02,372 WARN  [SimpleErrorReporter] UNDEFINED_VARIABLE (toAccount =
> null):
>
<snip/>

Two things to do:

(1) Make sure the <var> elements are inside the <onentry> (or
transition or onexit) -- which is where executable content is
permissible. Which reminds me, I think a schema is now available, so
its about time we start validating the documents in order to flag such
things at parsing.

(2) Add an empty expr attribute (expr="") to the <var> elements, or
wait for the next nightly (20060406) where this oddity will be fixed.

If that doesn't do it, please post a more complete snippet of the
document, so we can look at this further.

-Rahul


> =======
>
> Tried:
>
> <scxml>
> <state id="logged_in">
> ...
> <var name="fromAccount" />
> <var name="toAccount" />
>
>     <transition event="banking.transfer" cond="${empty fromAccount and
> empty toAccount}">
>            <var name="cb" expr="${Conversation}" />
>            <assign name="fromAccount" expr="${cb.request}" />
>            <send target="http://localhost:8080/app" targettype="client"
> event="banking.transfer" namelist="cb fromAccount toAccount" delay="0"
> hints="" sendid="0009"><vxml version="2.0">
> <form>
> <field name="input">
> <prompt>
> To Account?
> </prompt>
> <grammar src="builtin:grammar/digits?length=7"></grammar>
> <noinput><reprompt/></noinput><nomatch><reprompt/></nomatch>
> </field>
> <filled namelist="input">
> <submit next="http://localhost:8080/app/Voice" namelist="input"/>
> </filled>
> </form>
> </vxml>
>            </send>
>         <target next="logged_in" />
>     </transition>
>
> ======
>

---------------------------------------------------------------------
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