Praveen Odughat
Praveen Odughat

Reputation: 3

XSLT for merging multiple xml documents in BPEL

This is regarding xml transformation within BPEL. In my bpel process, data is coming from two separate sources (partnerLinks). Data from both sources is in the same xml format. I need to combine the data from the two XML documents into one xml document and then pass it back to the ESB. I was trying with bpel:doXslTransform()). I am not sure how to pass the two responses from the partnerLinks to this function in a single call.

I tried concatenating the two responses into a string within a message type variable and then pass this to the bpel:doXslTransform(). Is this the right approach to merge the data?

Upvotes: 0

Views: 1110

Answers (1)

Thilini Ishaka
Thilini Ishaka

Reputation: 953

Yes, you can do a bpel:doXslTransform here.

This involves receiving an XML document from one service, converting it to a different Schema to form a new request message, and sending the new request to another service. Such documentation conversion can be accomplished using XSLT via the bpel:doXslTransform function.

<variables>
   <variable name="A" element="foo:AElement" />
   <variable name="B" element="bar:BElement" />
</variables>
...
<sequence>
   <invoke ... inputVariable="..." outputVariable="A" />
   <assign>
      <copy>
         <from>
            bpel:doXslTransform("urn:stylesheets:A2B.xsl", $A)
         </from>
         <to variable="B" />
      </copy>
   </assign>
   <invoke ... inputVariable="B" ... />
</sequence>

Please refer http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html for further information.

Upvotes: 1

Related Questions