Using XSLT Transformations on Large Payloads (For Oracle BPEL Process Manager)

Until 11g Release 1 11.1.1.3, for XSLT operations in Oracle BPEL Process Manager, the result was cached into memory as a whole document in binary XML format. For large document processing, this caused out-of-memory errors. Starting with 11g Release 1 11.1.1.4, a the streamResultToTempFile property was added. This property enables XSLT results to be streamed to a temporary file and then loaded from the temporary file. Set streamResultToTempFile to yes when processing large payload using XSLT. The default value is no.

This property is applicable when using the following BPEL XPath functions:

  • ora:processXSLT('template','input','properties'?)

  • ora:doXSLTransformForDoc('template','input','name', 'value')

To configure large XML documents to be processed using XSLT:

  1. Create a BPEL common properties schema. For example:
    <?xml version="1.0" encoding="UTF-8"?>
    <xs:schema targetNamespace ="http://schemas.oracle.com/service/bpel/common" 
              xmlns:common = "http://schemas.oracle.com/service/bpel/common"
              xmlns:xs = "http://www.w3.org/2001/XMLSchema"
              elementFormDefault="qualified" blockDefault="#all">
       
      <xs:element name="serviceProperties"  type="common:PropertiesType"/> 
      <xs:element name="anyProperties"  type="common:ArrayOfNameAnyTypePairType"/> 
         <xs:complexType name="NameValuePairType">
        <xs:sequence>
          <xs:element name="name" type="xs:string"/>
          <xs:element name="value" type="xs:string"/>
        </xs:sequence>
       </xs:complexType>
       <xs:complexType name="ArrayOfNameValuePairType">
        <xs:sequence>
          <xs:element name="item" type="common:NameValuePairType"
     maxOccurs="unbounded"/>
        </xs:sequence>
       </xs:complexType>
       <xs:complexType name="NameAnyTypePairType">
        <xs:sequence>
          <xs:element name="name" type="xs:string"/>
          <xs:element name="value" type="xs:anyType"/>
        </xs:sequence>
       </xs:complexType>
       <xs:complexType name="ArrayOfNameAnyTypePairType">
        <xs:sequence>
          <xs:element name="item" type="common:NameAnyTypePairType"
     maxOccurs="unbounded"/>
        </xs:sequence>
       </xs:complexType>  
       <xs:complexType name="PropertiesType">
        <xs:sequence>
          <xs:element name="property" type="common:NameValuePairType"
     maxOccurs="unbounded"/>
        </xs:sequence>
       </xs:complexType>
       <xs:complexType name="ArrayOfAnyTypeType">
        <xs:sequence>
          <xs:element name="item" type="xs:anyType" maxOccurs="unbounded"/>
        </xs:sequence>
       </xs:complexType>   
    </xs:schema>
    
  2. Within a BPEL process, add the namespace in the import section:
    xmlns:common = "http://schemas.oracle.com/service/bpel/common"
    
  3. Create a global variable (for this example, named propertiesXMLVar):
    <variable name="propertiesXMLVar" element="common:anyProperties"/>
    
  4. Set the streamResultToTempFile property to yes. This assign activity should exist before performing an XSLT transformation.
    <assign name="Assign_xsltprop">
          <copy>
            <from>
               <common:anyProperties>
                 <common:item>
                       <common:name>streamResultToTempFile</common:name>
                       <common:value>yes</common:value>
                 </common:item>
               </common:anyProperties>
            </from>
            <to variable="propertiesXMLVar"/>
          </copy>
    </assign>