Bug 779168 (SOA-1563) - XsltAction - Custom SourceResult is not properly documented
Summary: XsltAction - Custom SourceResult is not properly documented
Keywords:
Status: CLOSED NEXTRELEASE
Alias: SOA-1563
Product: JBoss Enterprise SOA Platform 5
Classification: JBoss
Component: Documentation, JBossESB
Version: 5.0.0 ER1
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
: 5.0.0 GA
Assignee: Dana Mison
QA Contact:
URL: http://jira.jboss.org/jira/browse/SOA...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-10-27 13:57 UTC by Jiri Pechanec
Modified: 2010-02-12 10:21 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-02-12 10:21:48 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker SOA-1563 0 None None None Never

Description Jiri Pechanec 2009-10-27 13:57:25 UTC
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 Dana Mison 2010-01-06 05:30:28 UTC
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 Dana Mison 2010-01-06 06:48:09 UTC
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 15:10:25 UTC
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 Dana Mison 2010-01-21 05:36:59 UTC
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 10:21:48 UTC
Verified in CR1


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