# Overview: Dynamic Transformation Control

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:

- XQuery—contained in .xq files
- XSL—contained in .xsl files
- MFL—contained in .mfl files

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 and Transforming Non-XML Data.

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:

- Dynamic XQuery Transformation

- Method with HashMap. Use this base method to select the transformation when the argument type and values are unknown at design time. This method requires that you provide a HashMap with the variables and the types along with the XQuery file. The XML documents can be either typed or untyped. Use a Perform node to specify these values, as shown in the following:

    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);
    }

- Method with XmlObjects In XmlObjects Out. Use this base method to choose which XQuery to use for transforming untyped XML documents to untyped XML documents.
- Custom method. When you know the input types (arguments) at design time, you can define a custom method to choose which XQuery file to use for typed, untyped, or Java class documents.

- Dynamic XSLT Transformations

- Method with HashMap. Use this base method to select the transformation when the argument type and values are unknown at design time. This method requires that you provide a HashMap with the variables and the types along with the XSL file. The XML documents can be either typed or untyped. Use a Perform node to specify these values. See Dynamic XQuery Transformation.
- Custom method. When you know the input types (arguments) at design time, you can define a custom method to choose which XSL file to use for untyped documents (XmlObject).

- MFL—Five base methods provide the ability to select which MFL is invoked at run time based on the message context. Both binary-to-XML and XML-to-binary transformations are supported.

Note: To learn about the available base methods, see Using the Base Methods in the Dynamic Transformation Control.

Related Topics

Creating a New Dynamic Transformation Control

Using a Dynamic Transformation Control

Example: Dynamic Transformation Control

Transformation Data Using XQuery

Transforming Non-XML Data