<data> uses "name" attribute instead of "ID"
--------------------------------------------

                 Key: SCXML-74
                 URL: https://issues.apache.org/jira/browse/SCXML-74
             Project: Commons SCXML
          Issue Type: Bug
    Affects Versions: 0.8
            Reporter: Edzard Hoefig
            Priority: Minor


In the recent SCXML WD (WD-scxml-20080516), the <data> element is defined to 
use an "ID" attribute. Previously it had been "name" (WD-scxml-20070221). This 
change is not reflected in the source (see class 
org.apache.commons.scxml.model.Data) and leads to a NullPointerException when 
trying to use it.

Example: 

This SCXML document...

<?xml version="1.0" encoding="UTF-8"?>
<scxml xmlns="http://www.w3.org/2005/07/scxml"; version="1.0" 
initialstate="InitialState" >
        <datamodel>
                <data id="RequestForBerlin">
                        <GetWeather xmlns="http://www.webserviceX.NET";>
                          <CityName>Berlin</CityName>
                          <CountryName>Germany</CountryName>
                        </GetWeather>                           
                </data>
        </datamodel>
        <state id="InitialState">
                <transition target="GetWeatherState"/>
        </state>
        <state id="GetWeatherState">
                <invoke src="WeatherService#GetWeather" targettype="x-soap">
                        <param name="RequestForBerlin"/>
                </invoke>
        </state>
</scxml>

... leads to ...

...  java.lang.NullPointerException
        at 
org.apache.commons.scxml.env.SimpleContext.setLocal(SimpleContext.java:164)
        at 
org.apache.commons.scxml.SCXMLHelper.cloneDatamodel(SCXMLHelper.java:466)
        at org.apache.commons.scxml.SCXMLExecutor.reset(SCXMLExecutor.java:223)
        at org.apache.commons.scxml.SCXMLExecutor.go(SCXMLExecutor.java:351)
[...]

... because the name field of a Data class instance is null.

when changing the <data id="RequestForBerlin"> line to <data 
name="RequestForBerlin"> the problem dissapears.


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to