« Return to Thread: [jira] Created: (SCXML-74) uses "name" attribute instead of "ID"

[jira] Commented: (SCXML-74) <data> uses "name" attribute instead of "ID"

by JIRA jira@apache.org :: Rate this Message:

Reply to Author | View in Thread


    [ https://issues.apache.org/jira/browse/SCXML-74?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12612299#action_12612299 ]

Rahul Akolkar commented on SCXML-74:
------------------------------------

Thanks a lot for taking time to identify the changes. I should have pointed to the contributing patches page to make the process clearer:

   http://commons.apache.org/patches.html

I will take a look at committing the necessary changes (may be a week or two). We should retain the ability to use "name" (instead of "id") for backwards compatibility.


> <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
>             Fix For: 0.9
>
>
> 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.

 « Return to Thread: [jira] Created: (SCXML-74) uses "name" attribute instead of "ID"

LightInTheBox - Buy quality products at wholesale price!