Do simple assignments of the form <assign location="id" expr="value" />
work in commons scxml?

I have this state machine description:

<scxml xmlns="http://www.w3.org/2005/07/scxml";
          version="1.0"
          initial="Start">

    <datamodel>
            <data expr="true" id="VarBool"/>
            <data expr="1" id="VarInt"/>
            <data id="currentResponse" expr="&quot;Sorry I do not
understand!&quot;"  />
    </datamodel>

 <state id="Start">
  <onentry>
   <log expr="'Start'" />
  </onentry>
  <transition event="what-is-my-name" target="WhatIsMyName" />
  <transition event="current-weather" target="CurrentWeather" />
 </state>

 <state id="WhatIsMyName">
  <onentry>
   <log expr="'What is my name'" />
   <assign location="currentResponse" expr="&quot;Your name is noted!&quot;" />
  </onentry>
  <transition target="Start" />
 </state>


INFO: transition (event = what-is-my-name, cond = null, from = /Start,
to = /WhatIsMyName)
Feb 28, 2019 9:04:53 PM org.apache.commons.scxml2.SCXMLExecutionContext execute
INFO: null: What is my name
Feb 28, 2019 9:04:53 PM
org.apache.commons.scxml2.env.SimpleErrorReporter
handleErrorMessageWARNING: EXPRESSION_ERROR
(evalLocation('currentResponse'): java.lang.String cannot be cast to
org.w3c.dom.Node): Expression error inside /WhatIsMyNameFeb 28, 2019
9:04:53 PM org.apache.commons.scxml2.env.SimpleSCXMLListener onEntry
INFO: enter /WhatIsMyName

I have tried with both commons scxml version 0.9 as well as 2.0

Regards,

Diptendu Dutta

Reply via email to