![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Note: | The Dynamic Transformation control is available in BEA Workshop for WebLogic Platform only for licensed users of WebLogic Integration. |
A Dynamic Transformation control provides a business process with the ability to dynamically select and implement a transformation during run time. Specifically, it provides the ability to choose which XQuery, XSLT, or MFL file is invoked at run time. For example, if you have an integration hub that receives documents from different regional offices, you can use the Dynamic Transformation control to perform different transformations based on the area code of each regional office.
For general information about using controls, see Using Controls in Business Processes.
A Dynamic Transformation control provides a business process with the ability to dynamically select which transformation is invoked at run time.
This control provides eight base methods and the ability to create custom methods for selecting which file to use for your transformation. You can base the selection on the method context or the content of the message. The dynamic selection of the transformation is done through setting URIs that point to different transformation files. The available types of transformations are as follows:
The Dynamic Transformation control uses transformations that have already been created, such as those created with the Transformation control. Be sure to test your transformation before creating a Dynamic Transformation control. To learn more about Transformation controls and transforming data, see Transformation Data Using XQuery.
Before calling a Dynamic Transformation control, in the process of developing your business process, you need to design the logic that determines which transformation to run. You can use a Decision node or other controls, such as the Database or XML Metadata controls, for this purpose.
The Dynamic Transformation control provides the following methods:
public void perform() {
_map = new java.util.HashMap();
// The name should be the variable Name and the value the Document passed
_map.add("CustomerDoc",customerDoc);
}
Note: | To learn about the available base methods, see Using the Base Methods in the Dynamic Transformation Control. |
Creating a New Dynamic Transformation Control
Using a Dynamic Transformation Control
Example: Dynamic Transformation Control
Transformation Data Using XQuery
This topic describes how to create a new Dynamic Transformation control.
For information on where to add control instances in a business process, see "Adding Control Nodes to Your Business Process" in Using Integration Controls.
Note: | Before creating a Dynamic Transformation control, during design time, you need to create or import and test your transformation files. To learn more, see Guide to Data Transformation. |
Note: | If the Data Palette is not visible, from the menu bar, click Window![]() ![]() |
The Insert Control: Dynamic Transformation dialog box is displayed (see Figure 4-1).
A new Dynamic Transformation control and an instance of it are created and the instance of the control is displayed on the Controls tab of the Data Palette. The new file is displayed in the Package Explorer pane in BEA Workshop for WebLogic Platform. (You can double-click any control file to view or edit it in the Source view.)
This section describes ways to use a Dynamic Transformation control. It contains the following topic:
Once you have created the Dynamic Transformation control, you can add a control instance to your business process and invoke its base methods from within your application.
To learn about adding an instance of the Dynamic Transformation control to your business process, see Create Control Nodes in Your Business Process.
The following methods are available:
XmlObject[] performXQuery(String xQueryName,HashMap inputList)
Executes an XQuery and the arguments that it operates on based on message context.
XmlObject performXQueryOnXmlObject(String xQueryName,XmlObject inputDoc,String varName)
Executes an XQuery that takes an XmlObject in and XmlObject out.
XmlObject performXSLT(String xslTemplate,XmlObject source,HashMap inputList)
Executes an XSLT and the arguments that it operates on based on message context.
XmlObject convertBytesToXML(byte[] data,String mflUrl)
XmlObject convertInputStreamToXML(InputStream iStream,String mflUrl)
XmlObject convertRawDataToXML(RawData rawData, String mflUrl)
byte[] convertXmlToBytes(XmlObject xmlObject,String mflURL)
Executes MFL transformations from XML data to non-XML data.
RawData convertXmlToRawData(XmlObject xmlObject,String mflURL)
The @DynamicTransformationControl.Ddtf, @DynamicTransformationControl.Xquery, @DynamicTransformationControl.Xsl annotations control the behavior of these methods. Additional information is also available in the Interface DynamicTransformation.
Dynamic Transformation Control Annotations
Create Control Nodes in Your Business Process
To see an example of using a Dynamic Transformation control in a business process, see Solution Samples, which is located at the following URL:
http://download.oracle.com/docs/cd/E13214_01/wli/docs81/sol_samples/index.html
![]() ![]() ![]() |