Tuesday, July 29, 2014

Get Value from XML and Save into Siebel Property Set(XMLToPropSet)

When you deal with the web services, most of the time you need to parse XML document to get the data. Siebel has made the XML parsing easy by provided a Business Service “XML Converter”. This Business Service has two method “PropSetToXML” and “XMLToPropSet”.

In this post will discribe about the “XMLToPropSet” Method. This “XMLToPropSet” Method has an input argument “<Value>” of type string. We pass XML in this Input argument.

Lets take the below XML as a reference to understand the working of this method.
 
Sample XML:
<?xml version="1.0"?>
   <SiebelMessage>
      <Header>
         <HdrElement1>HDR1</HdrElement1>
         <HdrElement2>HDR2</HdrElement2>
         <HdrElement3>HDR3</HdrElement3>
      </Header>
      <Body>
        <BdyElement1>BDY1</BdyElement1>
           < BdyElement1A> BDY1A</ BdyElement1A>
           < BdyElement1B> BDY1B</ BdyElement1B>
           < BdyElement1C> BDY1C</ BdyElement1C>
         <BdyElement2>BDY2</BdyElement2>
           < BdyElement2A> BDY2A</ BdyElement2A>
           < BdyElement2B> BDY2B</ BdyElement2B>
           < BdyElement2C> BDY2C</ BdyElement2C>
     </Body>
  </SiebelMessage>

Workflow Steps:

1.       Define one process property of type string for Input and for Output define as per your XML Tags, Here we have defined as “XML”.
2.       Add a Business Service step into your workflow from workflow designer.
3.       Define the below properties for the step.
a.       Name: XML to PropSet
b.      Business Service name: “XML Converter”
c.       Business Service Method: “XMLToPropSet”
4.       Provide the Input argument for the step as below.
a.       Input Argument: “<Value>”
b.      Type: “Process Property”
c.       Propert Name: XML (which we declared in step 1)
5.       Now get the value from XML and Save into Siebel Property Set like below.
Example One:
a.       Property Name: HdrElement1(Process Property)
b.      Type: “Output Argument”
c.       Output Argument: Header. HdrElement1.<Value>

Example Two:
a.       Property Name: BdyElement1A (Process Property)
b.      Type: “Output Argument”
c.       Output Argument: Body. BdyElement1. BdyElement1A.<Value>

Note: You simple need to go to that element and get the value of that element by adding “.<Value>” in that.


Hope this helps you…  Happy Siebeling… J

No comments :

Post a Comment