Developing DTL Transformations
Creating Data Transformations
|
|
This chapter describes generally how to create and edit data transformations. It contains the following sections:
To create a transformation:
-
If you are currently viewing a transformation and you have made changes but have not yet saved them, InterSystems IRIS™ prompts you to confirm that you want to proceed (which will discard those changes).
InterSystems IRIS then displays a dialog box where you can specify the basic information for the transformation.
-
Specify some or all of the following information:
-
Package (required) Enter a package name or click the arrow to select a package in the current namespace.
-
Name (required) Enter a name for your data transformation class.
-
Description Enter an description for the data transformation; this becomes the class description.
-
Choose one of the following:
-
All Messages This transformation can be used with any input message type.
-
-
-
Or click the search icon for
Source Class and then select the class.
-
Source Document Type (applicable only if the messages are virtual documents) Enter or choose the document type of the source messages. You can choose any type defined in the applicable schemas loaded into this namespace.
-
-
Target Document Type (applicable only if the messages are virtual documents) Enter or choose the document type of the target messages. You can choose any type defined in the applicable schemas loaded into this namespace.
Apart from
Package and
Name, you can edit all these details later.
-
To open a transformation:
-
If you are currently viewing a transformation and you have made changes but have not yet saved them, InterSystems IRIS prompts you to confirm that you want to proceed (which will discard those changes).
-
Click the package that contains the transformation.
Then click the subpackage as needed.
-
Click the transformation class.
-
For a transformation, the Transform tab displays details that apply to the transformation as a whole. You may or may not have already specified some of these details. Other details can be edited only here. These details are as follows:
-
Name (read-only) Complete package and class name of the data transformation class.
-
Create Specifies how the transformation should create the target message. Choose one of the following:
-
new Create a new object of the target class (and type, if applicable), before executing the elements within the data transformation. This is the default.
-
copy Create a copy of the source object to use as the target object, before executing the elements within the transform.
-
-
-
Source Document Type (applicable only if the messages are virtual documents) Specifies the document type of the source messages.
-
-
Target Document Type (applicable only if the messages are virtual documents) Specifies the document type of the target messages.
-
Language Specifies the language you will use in any expressions in this DTL. This should be
objectscript.
-
Report Errors Specifies whether InterSystems IRIS should log any errors that it encounters when executing this transform. If you select this option, InterSystems IRIS logs the errors as
Warnings in the Event Log. InterSystems IRIS also returns a composite status code containing all errors as its return value. This option is selected by default.
-
Ignore missing source segments Specifies whether to ignore errors caused by attempts to get field values out of absent source segments. If you select this option, InterSystems IRIS suppresses these errors and does not call subtransforms where the named source segment is absent. This option is selected by default.
You can precisely control the behavior by including tests and conditional logic branches as wanted.
-
For
Create, the
existing option enables you to specify the target as an existing object, which results in a performance improvement. This option applies when you invoke a series of transformations programmatically (or perform other sequential processing). You would use this option in cases like the following scenario:
-
You have three transformations that you want to perform in sequence:
-
-
-
-
You invoke the transforms as follows:
do MyApp.ADTTransform.Transform(message,.target)
do MyApp.MRNTransform(target,.newtarget)
do MyApp.LabXTransform(newtarget,.outmessage)
This section describes generally how to add and edit the actions in a transformation. It includes the following subsections:
To add an action, you can always do the following:
-
Optionally click a source or target property, depending on the kind of action you want to add.
-
Select an action from the
Add Action drop-down list.
-
Edit the details for this action on the
Action tab.
If applicable, the property that you selected is shown in the
Property field, for use as a starting point. Optionally, you can disable the action with the
Disabled check box. If you disable a
foreach or
if action, all actions within the block are also disabled.
To edit an action, first select it. To do so:
-
Click the corresponding row in the table below the diagram.
-
(If the action is displayed in the diagram) Click the symbol that InterSystems IRIS displays on the corresponding connector line, in the center divider.
When you click this item, it changes color, the connector line turns bold, and the source and target property are highlighted in color. This means the connector is selected, as shown in the following figure.
Now edit the values on the
Action tab. Optionally, you can disable the action with the
Disabled check box. If you disable a
foreach or
if action, all actions within the block are also disabled.
Tip:
If you double-click a property in the diagram, InterSystems IRIS updates the currently selected action, if applicable. \If you double-click a field in the source, then the editor interprets it as your wanting to set the value for the selected action. Similarly, if you double-click a target field, the editor interprets it as your wanting to set the target for the selected action.
InterSystems IRIS executes the actions in the order they are listed in the table below the diagram.
To rearrange actions, you must use the table below the DTL diagram, as follows:
-
Click the row corresponding to that action.
-
Click one of the following icons in that row, as needed:
To undo the previous change, click the Undo button

.
To save a transformation, do one of the following:
-
-
Click
Save As. Then specify a new package, class name, and description and click
OK.
-
Click
Compile. This option saves the transformation and then compiles it.
To compile a transformation, click
Compile. This option saves the transformation and then compiles it.
To delete a transformation:
-
Click the row that displays its name.
-
-
Click
OK to confirm this action.
Content Date/Time: 2019-02-17 01:11:28