# Creating a Transformation File and a Transformation Method

This section describes how to create a Transformation file (also know as a DTF file because it ends in the .dtf extension). In addition, this section describes how to add a Transformation method to the DTF file. Each Transformation method contains a single data transformation—the mapping and conversion of data from one format to another.

Data Transformations in business processes can be created in the following ways:

- While creating a Client Request, Client Response, Control Send, Control Send with Return, or Control Receive nodes in a specific business process—For instructions on creating a transformation from a Client or Control node, see Interacting With Clients and Interacting With Resources Using Controls, respectively.
- While building a data transformation independent of a specific business process, from the WebLogic Workshop menu bar—This section describes how to create a standalone data transformation from the menu bar and store it in a DTF file. Creating a transformation stored in a standalone DTF allows for the reuse of the transformation in different nodes of a business process.

This section contains the following tasks:

- To Create a Transformation File From the Menu Bar
- To Add a Transformation Method to Transformation File

To Create a Transformation File From the Menu Bar

1. Open business process project and application.

Note: You must be active in a business process project, in order for Transformation File option to be available from the New File dialog box. (If the Application tab is not visible in WebLogic Workshop, choose View —> Application from the menu bar.)

2. In the Application tab, select a subfolder of a project folder. (Project folder names end with the string: Web.)
3. From the WebLogic Workshop menu bar, choose File —> New —> Transformation File.

The New File dialog box appears.

4. In the File name field, enter file.dtf, where file represents the file name in which the Transformation file is stored. In this example, the file name is dataTrans is entered.
5. Click Create.

In the Design View, a graphical representation of the dataTrans Transformation file appears, as shown in the following figure.

In addition, a Transformation file (ending in the .dtf extension) is created. For this example, the Transformation file called dataTrans.dtf is created and is visible in the Application tab.

To Add a Transformation Method to Transformation File

1. In the Design View, right-click in the box representing the dataTrans Transformation file. The box shown in the preceding figure. (Where dataTrans is the name of the Transformation file.)
2. From the drop-down menu, select Add Transformation Method.

A transformation method is created in the Transformation file.

3. Enter myTransMethod, where myTransMethod represents the method name.

The Transformation method in the Transformation file is created. This task does not however, create the XQ file to store the query. The XQ file is created in the following section. XQ files contain queries written in the XQuery language which end in the .xq extension.

In addition to transformation methods, user-defined Java methods can added to a Transformation file. (User methods are user-defined Java methods that can be called from XQuery code.) For instructions on adding a User method, see To Add a User Method to a Transformation File.

Note: You can also create transformation methods and user methods in the Design View of a DTF file, by dragging-and-dropping the Transformation Method and User Method icons, respectively from the Palette to the Design View.