Jun 26, 2008

The lost (collaxa) BPEL-tutorials: 103.XMLDocuments

After you have everything in place (follow this posting), let's step to this tutorial: 103.XMLDocuments
In this sample a "complex" xml document is created within the bpel. Sometimes you have to answer the question: there is a xml document with many defaults and you want to update only a few parameters.
Here the solution:
Build a BPEL and use a xsd which corresponds to your complex xml document. In this BPEL add an assign with the following operation:


The option "XML Fragment" can be chosen in the pulldown menu within the create operation dialog.
Into this XML Fragment you have to add the following xml


if your XSD looks like this:

<schema targetNamespace ="http://samples.otn.com/finance"
xmlns = "http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified"/>
<complexType name="StockReviewSheetType"/>
<sequence/>
<element name="symbol" type="string" />
<element name="targetPrice" type="float" />
<element name="currentPrice" type="float" />
<element name="action" type="string" />
<element name="quantity" type="int" />
<sequence/>
<complexType/>
<schema/>

Very important is to specfy the right namespace in the xml fragment. If you forget this, the assign is executed, but it is like you assign values to the variables of com.gip.myclass and you need them in com.xyna.myclass.... This will break your workflow not now, but later...

No comments:

Post a Comment