Passing parameters to ora:processXSLT

When processing XML with XSLT you can easily pass values handled as global parameters to an XSLT script. The BPEL XPath extension function processXSLT offers the same kind of functionality, even though this is not obvious at first glance.

The BPEL Process Manager Developer’s Guide describes processXSLT as “a function that returns the result of an XSLT transformation” and defines the signature as


where template is the name of the XSLT file, input referes to the XML strcuture on which the transformation is run and properties are “The properties as defined in the bpel.xml file”.

That’s an information , isn’t it? I’m sure you’ve immediately understood what to do. Well, I was puzzled.

After some research I found out that properties conforms to name/value pairs complying to the following schema definition:

<?xml version="1.0" encoding="UTF-8" ?>
<xsd:schema xmlns:xsd=""
  <xsd:element name="parameters">
        <xsd:element name="item" minOccurs="1" maxOccurs="unbounded">
              <xsd:element name="name" type="xsd:string"/>
              <xsd:element name="value" type="xsd:string"/>

You can put this definition into a file, name it for example “Parameters.xsd” and import it into your WSDL file to make it available to your BPEL process.

In your BPEL file you first define the namespace of the structure as part of the <process>-element, e.g. as xmlns:bco=”; and declare a matching variable:

<variable name="Parameters" element="bco:parameters"/>

Then you fill the variable with an XML fragment that declares the parameters you want to pass to processXSLT. This way you can dynamically assign values to the items within the fragment in one of the upcoming steps.

Now that we’ve done all the basic preparation I’d like to show you how to proceed by example. First we simply create two parameters named ParamOne and ParamTwo and copy their einclosing XML fragment into the above defined variable Parameters.

		<parameters xmlns="">
	  <to variable="Parameters" query="/bco:parameters"/>

Next we assign the current date and time to the first parameter (ParameterOne) and a value that we received (for example) from the invocation of a service to the second parameter (ParameterTwo).

	  <from expression="ora:getCurrentDateTime()"/>
	  <to variable="Parameters"
	  <from expression="bpws:getVariableData('Invoke_callDummy_OutputVariable','payload',
	  <to variable="Parameters"

Now that we have filled our parameters with life, we can pass the data to the processXSLT call – let’s assume that myVar contains some kind of XML structure on which the transformation is executed.

  <from expression="ora:processXSLT('myTransformation.xsl', bpws:getVariableData('myVar'),
  <to variable="InputVariable_P" part="payload"

In order to access the passed information we simply declare two global parameters within myTransformation.xsl:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl=""

    <xsl:param name="ParameterOne"/>
    <xsl:param name="ParameterTwo"/>

<xsl:output method="xml" encoding="UTF-8" indent="yes"/>

Actually, that’s it. Now you can access the parameters with $ParameterOne and $ParameterTwo everywhere in your XSLT.

Posted in BPEL, SOA. 3 Comments »

3 Responses to “Passing parameters to ora:processXSLT”

  1. pavan Says:


    You explanation is very clear. Thanks for providing such a valuable information. I’m trying the same in my project and getting following error while deployment of composite.

    [scac] error: in XXX.bpel(68): XML element “{}parameters” of variable “Parameters” is not defined

    Could you please help me in this and also could you clarify me on the following

    1) If i access $ParameterOne in my xslt, will i get name-value pair or only value.
    2) If i get name-value pair, can i use $ParameterOne/name & $ParameterOne/value for getting the name & value.

    Thanks in advance.


    • ake Says:

      Hi Pavan,

      I assume you are getting the error because you haven’t created a schema file with the type definitions (Parameters.xsd) and imported it into your WSDL.

      1) You’ll get the value. In the key/value-pair the key simply refers to the name of parameter as it is being used in the XSLT.
      2) $ParameterOne actually is the name of the key.

      I hope I could help you with my response.

      – Alex

  2. Jesús Says:

    Hi Alex,

    I really want to thank you your time for writing this article. Without a doubt, it has helped me a lot after spending more than 7h trying to develop such behaviour. However, once i came across with your post, I could solve my issue.
    As you said, the guide wasn’t clear at all, and I was puzzled too!!
    Thank you very much dude.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: