Table of Contents

Search

  1. Preface
  2. Welcome to Informatica Process Developer
  3. Using Guide Developer for the First Time
  4. Getting Started with Informatica Process Developer
  5. About Interfaces Service References and Local WSDL
  6. Planning Your BPEL Process
  7. Participants
  8. Implementing a BPMN Task or Event in BPEL
  9. Implementing a BPMN Gateway or Control Flow
  10. Using Variables
  11. Attachments
  12. Using Links
  13. Data Manipulation
  14. Compensation
  15. Correlation
  16. What is Correlation
  17. What is a Correlation Set
  18. Creating Message Properties and Property Aliases
  19. Adding a Correlation Set
  20. Deleting a Correlation Set
  21. Adding Correlations to an Activity
  22. Rules for Declaring and Using Correlation Sets
  23. Correlation Sets and Engine-Managed Correlation
  24. Event Handling
  25. Fault Handling
  26. Simulating and Debugging
  27. Deploying Your Processes
  28. BPEL Unit Testing
  29. Creating POJO and XQuery Custom Functions
  30. Custom Service Interactions
  31. Process Exception Management
  32. Creating Reports for Process Server and Central
  33. Business Event Processing
  34. Process Central Forms and Configuration
  35. Building a Process with a System Service
  36. Human Tasks
  37. BPEL Faults and Reports

Designer

Designer

bpel doXslTransform(style-sheet-uri node-set)

bpel doXslTransform(style-sheet-uri node-set)

Returns the result of an XSL transformation of a single element node set using the specified style sheet.
Parameters:
  • style-sheet-uri
    : URI for the XSL file.
  • node-set
    : XPath node set providing the source document for the transformation.
Example syntax:
bpel:doXslTransform("project:/myStylesheets/A2B.xsl", $A)
Optional parameters (must appear in pairs if specified)
  • string
    : XPath string parameter providing the qualified name of an XSLT parameter.
  • object
    : XPath object parameter providing the value for the named XSLT parameter.
Examples
The following examples show complex document transformation and iterative document construction.
Example 1. Complex Document Transformation.
A common pattern in a WS-BPEL process 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 document conversion can be accomplished using XSLT via the
bpel:doXslTransform
function, as shown in the following example.
<variables> <variable name="A" element="foo:AElement" /> <variable name="B" element="bar:BElement" /> </variables> ... <sequence> <invoke ... inputVariable="..." outputVariable="A" /> <assign> <from> bpel:doXslTransform("urn:stylesheets:A2B.xsl", $A) </from> <to variable="B" /> </assign> <invoke ... inputVariable="B" ... /> </sequence>
In the sequence, a service is invoked, and the result (
foo:AElement)
copied to variable A. The assign activity transforms the contents of variable A to
bar:BElement
, and copies the result to variable B. Variable B is used to invoke another service. The style sheet,
A2B.xsl
, contains the XSL rules for converting documents of schema
foo:AElement
to schema
bar:BElement
.
Example 2. Iterative Document Construction.
Suppose that a document is constructed by repeatedly calling a service and accumulating the result in a variable, as shown in the following example:
<variables> <variable name="PO" element="foo:POElement" /> <variable name="OutVar" element="foo:ItemElement" /> </variables> <!-- ... PO is initialized ... --> <!-- Iteratively add more items to PO until complete --> <while> <condition>...</condition> <sequence> <!-- Fetch next chunk into OutVar --> <invoke ... inputVariable="..." outputVariable="OutVar"/> <assign> <copy> <from> <expression> bpel:doXslTransform ( "urn:stylesheets:AddToPO.xsl", $PO, "NewItem", $OutVar) </expression> </from> <to variable="PO" /> </copy> </assign> </sequence> </while>
The optional parameters given in the
doXslTransform
call specify that the XSLT parameter named
NewItem
is set with the value of the process variable
OutVar
. To allow the XSLT style sheet access to this value, it contains a global (top-level) parameter with a name matching that given in the third parameter of the function call shown above.
<xsl:transform version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" ...> <!-- NewItem variable set by WS-BPEL process; defaults to empty item --> <xsl:param name="NewItem"> <foo:itemElement /> </xsl:param> ... </xsl:transform>
The style sheet contains a template that appends the value of global parameter NewItem (the value of
OutVar
from the process instance) to the existing list of items in the PO variable.
<!-- line 1 --> <xsl:template match="foo:itemElement"> <!-- line 2 --> <xsl:copy-of select="." /> <!-- line 3 --> <xsl:if test="position()=last()"> <!-- line 4 --> <xsl:copy-of select="$NewItem" /> <!-- line 5 --> </xsl:if> <!-- line 6 --> </xsl:template>
This template copies all existing items in the source document (lines 1 & 2) and appends the contents of the XSLT parameter
NewItem
to the list of items (lines 3 & 4). It tests to see if the current node is at the end of the item list (line 3) and copies the
result-tree
fragment from the XSLT parameter
NewItem
to follow the last item (line 4).
If PO has a value of:
<foo:poElement> <foo:itemElement>item 1</foo:itemElement> </foo:poElement>
at the beginning of an iteration of the while loop and the invoke activity returns a value of
<foo:itemElement>item 2</foo:itemElement>
, evaluation of the from expression will result in a value of:
<foo:poElement> <foo:itemElement>item 1</foo:itemElement> <foo:itemElement>item 2</foo:itemElement> </foo:poElement>
When the copy operation completes, it becomes the new value of the PO variable.
Adding an XSL Style Sheet to Process Server
A style sheet that you reference in a
doXslTransform
function is automatically recognized by Process Developer and is added to a BPR archive for deployment.

0 COMMENTS

We’d like to hear from you!