Index Changes

Calling XSLT Transformation using the 'doXslTranform' function

The BPEL editor has an extension function called 'doXslTranform' in its mapper tool, which can be used in a BPEL 'Assign' activity to call a XSLT transformation.

Let us consider a trivial BPEL process example where we will use the 'doXSLTransform' function that takes an input message of 'shoe' and transforms it to an return message consisting of 'shoe{ShoeMart}' and a price of '$50.00' for the shoe.

The input variable '$InputVar' is defined by

            <xsd:element name="inputString" type="xsd:string"></xsd:element>

The output variable '$OutputVar' is defined by

            <xsd:complexType name="returnType">
                    <xsd:element name="product" type="xsd:string"/>
                    <xsd:element name="value" type="xsd:string"></xsd:element>

Clicking on the function name in the dropdown menu shown in the figure above will drop the functiod into the selected band in the mapper for the output message 'OutputVar'. The 'doXslTransform' functoid is as shown below.

Arguments to the function:

  • The first handle of the functoid namely 'String'(graphical representation of the first argument to the function) should be assigned a string literal of the name of the XSL transformation file which in this case is 'SimpleTransform.xsl'. The user will have to enter the string literal as shown.
Notice that the literal 'urn:stylesheets:' as to be appended to the name of the XSL file.
  • The Second argument 'Node Set' will be connected to the 'InputVar' variable that is the input to the XSL transform.
  • The other arguments in the functiod represents place holders to pass other arguments to the XSL transform if required, which is not used in our example.
  • The output 'Node' represents the output from the XSL transform that needs to be connected to the output variable 'OutputVar'.

We are ready to define the 'Assign' activity to call the XSLT transformation. The mapping using the 'doXslTransform' function is as shown.

The generated code for the mapping is as shown

              <assign name="doXslTranform">
                         <to variable="OutputVar" part="part1"/>

So with a few simple steps we are able to call an XSL transform from within a BPEL 'Assign' activity. Now cerate 'Composite Application' project, include the BPEL project in it and deploy it to the Glassfish integration server. See the Video - BPEL and Composite Application Authoring for how to deploy and run a test using the Composite Application project suite.

Create a test case in the composite application project and run it with the input file.


and notice the correct output after the XSL file transformation in the output file.

<?xml version="1.0" encoding="UTF-8"?>
    <ns1:returnElem xmlns:ns1="">
      <product xmlns="">shoe[ShoeMart]</product>
      <value xmlns="">$50.00</value>


Working example:

  • BPEL project: cvs -d co open-jbi-components/driver-tests/bpelse/xslt/DoXslTransformBPEL
  • Comp App project: cvs -d co open-jbi-components/driver-tests/bpelse/xslt/DoXslTransformJBI

JSPWiki v2.4.100
« Home Index Changes Prefs
This page (revision-14) was last changed on 20-Nov-08 19:11 PM, -0800 by Murali