Introduction to DTL Tools
This chapter introduces the tools that InterSystems IRIS® provides to enable you to develop and test DTL transformations.
A data transformation creates a new message that is a transformation of another message. It is common for a production to use data transformations, to adjust outgoing messages to the requirements of the target systems.
You can create and edit a DTL transformation visually in the DTL editor, available in either the Management Portal or Studio. The DTL editor is meant for use by nontechnical users. The term DTL represents Data Transformation Language, which is the XML-based language that InterSystems IRIS uses internally to represent the definition of a transformation that you create in this editor.
You can invoke a data transformation from a business process, another data transformation, or a business rule. Note that there is overlap among the options available in business processes, data transformations, and business rules. For a comparison, see “Comparison of Business Logic Tools” in Developing Productions.
Introduction to the Data Transformation Builder Page
The Data Transformation Builder page enables you to create, edit, and compile DTL transformations.
To access this page in the Management Portal, select Interoperability > Build > Data Transformations.
When you display this page, it shows the last transformation you opened in this namespace, if any. This page has the following areas:
The ribbon bar that the top displays options you can use to create and open DTL transformations, compile the currently displayed transformation, change the zoom display of the diagram, and so on.
For information on these options, see the chapter “Creating Data Transformations.”
The upper part of the left area displays the DTL diagram. The next section provides details on this area.
The lower part of the left area displays a table that lists the actions defined in the DTL transformation. When InterSystems IRIS uses this transformation, it performs these actions in order as listed here.
The right area displays three tabs:
Transform — Enables you to edit information about the transformation. For details, see “Specifying Transformation Details,” later in this book.
You can resize these three areas.
If you open a DTL transformation class in Studio, Studio displays a similar version of this page. You can view and edit the XML definition of the Data Transformation by selecting View other code from the Studio Data Transformation Builder page.
Introduction to the DTL Diagram
The following shows the DTL diagram for a DTL class:
Note the following points:
The left area displays the source message. The header above the column displays the name of the source message class, and the boxes in the column display properties of the source message.
The right area displays the target message in the same way.
The top area includes a scroll button for each of these areas.
The diagram shows connectors that represent actions within the transformations. The actions displayed here copy values from source properties to target properties.
The center divider (the blue column) displays an icon on each connector line. The purpose of these icons is to enable you to select the connectors more easily. (You can select a connector line anywhere on its length, but it is easier to click the icons shown in this center divider.)
The following shows another example:
In this case, the source and target classes are more complex. Note the following additional points:
The FavoriteColors property is defined as list of strings. This property is displayed here with parentheses () at the end of its name.
In this example, Allergies is another collection property.
The Address property is defined as an object that has the Street, City, and ZipCode properties. Notice that the box for this property contains a triangle inside it.
In the left column, this property is displayed in expanded mode, so that you can see the properties. The triangle in the box is not solid and is pointing down.
The right column, this property is displayed in collapsed mode. The triangle in this box is solid and is pointing to the right.
For the Address properties, the connector is shown with a dashed line on the side where the Address is collapsed. This indicates that there are hidden sub-properties on this side of the assign action.
Controlling the Display
You can control the display of the Data Transformation Builder page in multiple ways:
You can click a View option in the ribbon bar:
Use the buttons to view both the transform diagram and the action list in the left pane of the page, or instead to collapse the section you do not want to see.
You can select a zoom option from the drop-down list in the ribbon bar. By default, this list displays 100%. Click a value in the list to shrink or enlarge the size of the DTL diagram.
Use the scroll bars in the header area of the DTL diagram, as described in the previous section.
Collapse and expand the display of properties, as described in the previous section.
Introduction to the Data Transformation List Page
The Interoperability > List > Data Transformations page lists the data transformation classes defined in the current namespace.
This page lists two kinds of transformations:
DTL transformations are displayed in blue. You can double-click one to open it in the Data Transformation Builder.
Custom transformations are displayed in black. These classes are based on Ens.DataTransformOpens in a new window and do not use DTL. You must edit these in a supported IDE such as Studio.
To use this page, select a transformation class and then click one of the following commands in the ribbon bar:
Edit — (DTL transformations only) Click to change or view the data transformation using the Data Transformation Builder.
Test — Click to test the selected transformation class using the Test Transform wizard.
For details, see the chapter “Testing Data Transformations,” later in this book.
Delete — Click to delete the selected transformation class.
Export — Click to export the selected transformation class to an XML file.
Import — Click to import a data transformation that was exported to an XML file.
You can also export and import these classes as you do any other class in InterSystems IRIS. You can use the System Explorer > Globals page of the Management Portal or use the Export and Import commands on the Tools menu in Studio.
You can also invoke a data transformation programmatically, which can be useful for testing purposes. For details, see the chapter “Testing Data Transformations.”
Also, because data transformations are classes, you can edit them and work with them in the same way that you do any other class.
Using Data Transformations
You can invoke a data transformation from the following parts of a production:
From a BPL business process. See “<transform>” in the Business Process and Data Transformation Language Reference.
From a business rule. See “Selecting the Transformation and Target of a Send Action” in Developing Business Rules.
From a custom business process or a custom DTL transformation. To do so, execute it programmatically as described in the chapter “Testing Data Transformations.”
This section applies to both DTL transformations and custom transformations.