Hi Diptendu,

Please see my comments inline.

On Sat, Mar 16, 2019 at 8:19 AM Diptendu Dutta <dutta.dipte...@gmail.com> wrote:
>
> I have the following code that is working in 0.9 but failing in 2.0-SNAPSHOT
> .
>
> SCXMLExecutor engine;
> Context rootContext;
> Evaluator evaluator;
>
> .....
> rootContext = evaluator.newContext(null);
> engine.setRootContext(rootContext);
> engine.go();
>
> rootContext.set("intent", "StartBot");
> engine.triggerEvent("run", TriggerEvent.SIGNAL_EVENT);
>
>
> ----------------------
>     <scxml xmlns="http://www.w3.org/2005/07/scxml";
>               version="1.0"
>               datamodel="jexl"
>               initial="Start">
>
>         <datamodel>
>                 <data id="intent" expr="&quot;hello&quot;" />
>          ....
>         </datamodel>
>
>      <state id="Start">
>       <transition event="run" cond="intent eq &quot;startBot&quot;"
> target="StartBot" />
>       <transition event="run" target="Default" />
>     </state>
>
>      <state id="Default">
>       <onentry>
>        <log expr="intent" />
>        <assign location="response" expr="&quot;Sorry I do not
> understand!&quot;" />
>       </onentry>
>       <transition target="Start" />
>      </state>
>
>      <state id="StartBot">
>             .....
> --------------------------------------------------------------------------------------
> The StartBot state is not entered, rather the Default state is entered and
> the value
> of the "intent" datamodel item is printed as 'hello' rather than 'StartBot'
> as expected
>
> INFO: transition (event = run, cond = null, from = /Start, to = /Default)
> INFO: null: hello
>
> This same code is working with version 0.9.
>
> Do I have to do things differently with 2.0-SNAPHOT for it to work?

It looks like the evaluator in v2 is case-sensitive.
I think it would work with: cond="intent eq &quot;StartBot&quot;" -
'StartBot', not 'startBot'.

Regards,

Woonsan

>
> Regards,
>
> Diptendu Dutta

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

Reply via email to