[ https://issues.apache.org/jira/browse/SCXML-70?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12580002#action_12580002
]
Rahul Akolkar commented on SCXML-70:
------------------------------------
I seem to remember that the <data> element was returned because its contents don't necessarily
have to be a tree (and for a forest, the first child selection criteria seems arbitrary).
It will be great if you could convert the snippets above into a commented JUnit test case
for the (existing) Commons SCXML test suite, and attach that as a patch.
Finally, its unlikely that we will make behavioral changes here (in a point or minor release).
We may just have to document it the v0.x series, rather than break existing code that may
rely on this behavior.
> Inconsistent behavior between Data(name, '.'), single-node XML tree and multiple-node
XML tree within <send> namelist
> ---------------------------------------------------------------------------------------------------------------------
>
> Key: SCXML-70
> URL: https://issues.apache.org/jira/browse/SCXML-70
> Project: Commons SCXML
> Issue Type: Improvement
> Affects Versions: 0.5, 0.6, 0.7
> Reporter: Javier Arauz
> Priority: Minor
> Fix For: 1.0
>
> Original Estimate: 48h
> Remaining Estimate: 48h
>
> When using JEXL, expression Data(name, '.') correctly returns the first node in the set
of XML trees under data element 'name'. However, when executing a <send> action that
includes 'name' in the namelist attribute, what is passed down to the execution environment
is an XML tree rooted with a <data> element.
> That semantic of <send> is not usually what an application expects. For instance,
say the application wants to send back an HTML page to a requesting client:
> <data name='ContentType' expr='text/html'/>
> <data name='EntityBody'><html><body>Hi there!</body></html></data>
> <send targettype='x-http' namelist='ContentType EnttityBody'/>
> The execution environment receives 'text/html' in the parameter 'ContentType', as expected.
But in parameter 'EntityBody' it receives a <data> node wrapping the HTML content, which
when sent to the client can't of course be properly handled. This forces the execution environment
to perform specific processing for the latter case.
> To align the three behaviors, the first child of the <data> element (as opposed
to the <data> element itself) should be passed down to the execution environment in
all cases.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.