Bug 779168 - (SOA-1563) XsltAction - Custom SourceResult is not properly documented
XsltAction - Custom SourceResult is not properly documented
Status: CLOSED NEXTRELEASE
Product: JBoss Enterprise SOA Platform 5
Classification: JBoss
Component: Documentation, JBossESB (Show other bugs)
5.0.0 ER1
Unspecified Unspecified
high Severity high
: ---
: 5.0.0 GA
Assigned To: Darrin Mison
http://jira.jboss.org/jira/browse/SOA...
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2009-10-27 09:57 EDT by Jiri Pechanec
Modified: 2010-02-12 05:21 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-02-12 05:21:48 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
JBoss Issue Tracker SOA-1563 None None None Never

  None (edit)
Description Jiri Pechanec 2009-10-27 09:57:25 EDT
Date of First Response: 2010-01-06 00:30:28
project_key: SOA

Custom SourceResult needs to have resultType set to SOURCERESULT if the original result has to be used. Otherwise resultType must be in conformance with the SourceResult that was created by previous action in pipeline.
Comment 1 Darrin Mison 2010-01-06 00:30:28 EST
Sorry I'm not sure I understand this.

As far as I know, if resultType is set to SOURCERESULT: the direct output of the transform is the result that is returned by the action.  It is not cast into another type.

I'm not sure what you mean by "Otherwise resultType must be in conformance with the SourceResult that was created by previous action in pipeline"
Comment 2 Darrin Mison 2010-01-06 01:48:09 EST
Ah I think I understand.

If your payload is a SourceResult object:

Setting the  resultType to SOURCERESULT will return a result object of the same type as the result attribute of the payloads SourceResult object.

Otherwise the result will be cast to the type specified in resultType and you must ensure that the type-cast is valid.
Comment 3 Jiri Pechanec 2010-01-06 10:10:25 EST
Check
http://anonsvn.jboss.org/repos/labs/labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/transformation/xslt/ResultFactory.java
and method process in http://anonsvn.jboss.org/repos/labs/labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/transformation/xslt/XsltAction.java

You can send SourceResult object as the payload of the message sent to action.
If resultType is set to SOURCERESULT then the action will write a result directly to the object represented by result attribute of the payload's SourceResult object and the output of the action will be this result object.
Setting the resultType to  something else like String, then the action will expect that result attribute is of type StreamResult, etc. see method extractResult and the output of the action id converted object.

Which is almost the same as you written just instead of type-cast valid is probably better said conversion compatible or similar.
Comment 4 Darrin Mison 2010-01-21 00:36:59 EST
added SOURCERESULT to the list of resultTypes with the description:

SOURCERESULT
When the message payload contains a SourceResult object this produces a result of the same type as the result attribute of the payload's SourceResult object.

and after the list of resultTypes I added this paragraph:

When the message payload is a SourceResult object and resultType is not set to SOURCERESULT, the result is returned as the type specified in resultType. The developer is responsible for ensuring that the types are compatible.
Comment 5 Jiri Pechanec 2010-02-12 05:21:48 EST
Verified in CR1

Note You need to log in before you can comment on or make changes to this bug.