Apache Commons中的<assign>标记使用位置错误打开scxml

时间:2019-02-28 15:53:31

标签: scxml apache-commons-scxml

我有以下状态机描述:

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

当状态WhatIsMyName变为活动状态时,出现此错误:

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 handleErrorMessage
WARNING: EXPRESSION_ERROR (evalLocation('currentResponse'): java.lang.String cannot be cast to org.w3c.dom.Node): Expression error inside /WhatIsMyName
Feb 28, 2019 9:04:53 PM org.apache.commons.scxml2.env.SimpleSCXMLListener onEntry
INFO: enter /WhatIsMyName

我正在使用Apache Commons SCXML版本2 commons-scxml2-2.0-M1.jar。

上面使用的xml语法有问题吗?

0 个答案:

没有答案