- Difference between BPEL 1.1 & BPEL 2.0
- Using Oracle BPEL Process Manager Sensors
- Using the Notification Service
- Using Events & Timeouts in BPEL Processes
- Using Correlation Sets & Message Aggregation
- Manipulating XML Data
- Incorporating Java & Java EE Code
- Resubmitting a Faulted Process
- Using Fault Handling
- Using Conditional Branching
- Using Parallel Flow
- Invoking an Asynchronous Web Service
- Invoking a Synchronous Web Service
- Multiple Application Interactions
- Partial Processing
- One Request, a Mandatory Response, & an Optional Response
- One Request, One of Two Possible Responses
- One Request, Multiple Responses
- Asynchronous Interactions with a Notification Timer
- Asynchronous Interactions with a Timeout
- Asynchronous Interactions
- Synchronous Interactions
- One-Way Messages
- Process Monitors
- BPEL - Adapters
- Creating a Partner Link
- Partner Link in BPEL Process
- BPEL - Activities
- BPEL - Introduction
- BPEL - Home
BPEL Useful Resources
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
BPEL - Manipulating XML Data
XPath is mainly used to manipulate XMLs in the BPEL process. There are some valuable Xpath functions that can be used for manipulating XML. Let us see the functions below.
bpel:getVaribleData(varName, partName, xpathStr)
This can be used to extract a set of elements from a variable, using a XPath expression.
<bpel:copy> <bpel:from> <![CDATA[count(bpel:getVariableData(‘$Variable , $partName )/ns:return)]]> </bpel:from> <bpel:to variable = "itemNumber"> </bpel:to> </bpel:copy>
bpel:getLinkStatus()
This can be used to evaluate and return a Boolean whether a particular pnk is active or inactive.:getVariableProperty(string, string)
This is helpful in extracting properties in Variables.:doXSLTTransform()
This performs the XSLT transformations.string ()
This can be used to extract text content out of elements rather using /text ().string-length()
This function is used to calculate the length of the string. But the != operator seems not to work with the output from this function. So you can use > or < rather using ! = .Boolean Values
You can assign boolean values with the XPath boolean function.
<assign> <!-- copy from boolean expression function to the variable --> <copy> <from expression = "true()"/> <to variable = "output" part = "payload" query="/result/approved"/> </copy> </assign>
Assigning a Date or Time
You can assign the current value of a date or time field by using the Oracle BPEL XPath function getCurrentDate, getCurrentTime, or getCurrentDateTime, respectively.
<!-- execute the XPath extension function getCurrentDate() --> <assign> <copy> <from expression = "xpath20:getCurrentDate()"/> <to variable = "output" part = "payload" query = "/invoice/invoiceDate"/> </copy> </assign>
Concatenating Strings
Rather than copying the value of one string variable (or variable part or field) to another, you can first perform string manipulation, such as concatenating several strings.
<assign> <!-- copy from XPath expression to the variable --> <copy> <from expression = "concat( Hello , bpws:getVariableData( input , payload , /p:name ))"/> <to variable = "output" part = "payload" query = "/p:result/p:message"/> </copy> </assign>
Assigning String Literals
You can assign string pterals to a variable in BPEL.
<assign> <!-- copy from string expression to the variable --> <copy> <from expression = " GE "/> <to variable = "output" part = "payload" query = "/p:result/p:symbol"/> </copy> </assign>
Assigning Numeric Values
You can assign numeric values in XPath expressions.
<assign> <!-- copy from integer expression to the variable --> <copy> <from expression = "100"/> <to variable = "output" part = "payload" query = "/p:result/p:quantity"/> </copy> </assign>
Note − A few XSLT functions were used to transform an XML document.
Advertisements