Work with Transformations
A transformation is a special type of data association between input and output data types that don’t match. A transformation both associates input and output objects and maps their types. And because transformations are reusable, you can configure them once for use throughout the application, then apply them as needed.
Transformations are particularly useful for matching slightly differing data attributes, such as address or employee data. For example, your process might connect to a service that returns employee data with slightly different attributes that need to be mapped. In the illustration below, the bottom two associations are transformations between mismatched address objects.
You can use transformations with arrays, and they're applied to each item in the array.
Note that transformations have their own icon, which differs slightly from the data association icon. As with data associations, the icon is green when valid. When invalid, the icon is red and its error displays.
You create and apply transformations while configuring data associations. You can either transform a selected data association or create a transformation and then apply it. You can even create transformations within transformations.
Create, Apply, and Edit Transformations
You create and apply transformations while creating data associations.
- In the process editor, follow the steps to configure a data association. Select a flow element that needs data association, click the Data Association button, and map objects to the association input and output fields.
- Click the data association icon, and select Transform. (The association can be valid or invalid.)
- In the Transformations window (named based on the objects you selected), click Create. In the New Transformation dialog box, enter a name, and click Create. The Transformation Editor displays. It looks and functions much like the Data Association Editor, except that its left and right panes reflect the selected objects to transform.
- Configure a transformation between the objects by dragging and dropping elements to the input and output fields. You can also begin typing and select from autocomplete entries that display.
If needed, click the fx (Expression) icon and use the Expression Editor to create an expression for an input field. See Work with Expressions.
- Click Save to save the transformation. You can use the Save As button to create a new transformation based on the selected one.Process applies and validates the new transformation, displaying a green transformation icon if valid, or a red transformation icon and error if invalid. Note that you can save an invalid transformation and fix it later.Valid transformationInvalid transformation
- Click the Data Association link to close the transformation editor and return to the data association editor.
- Create, edit, or change transformations as needed.
At any time, you can display a list of all transformations defined for the application by clicking the Transformations button in the Data Association Editor. This displays the All Transformations window, which includes options for searching for, creating, editing, and deleting transformations. If creating a transformation from this window, you must select the input and output objects to transform from the application data objects listed in From and To fields, then apply the transformation to a data association.
- To apply a transformation to a data association, click its icon in the Data Association Editor and select the Transform link. From the list of transformations available for the selected data types, select a transformation to apply and click OK.
- To apply a different transformation, click a transformation icon in the Data Association Editor and select the Change link. From the list of transformations available for the selected data types, select another transformation and click OK.
- To edit a transformation, click its transformation icon in the Data Association Editor, select the Edit link, and make edits in the Transformations Editor.
- To delete a transformation, click the Transformations button, select it from the Transformations list, and click Delete. If the transformation is in use, a warning lists where it's in use and will be removed if you proceed with the deletion.
Create Transformations Between Enum Items
You can create and apply transformations between enum items when creating data associations.
- In the process editor, follow the steps to configure a data association: select a flow element that needs data association, and click Data Association.
- In the data association editor, drag and drop source and target enums. Click the invalid association icon, and select Transform.
- In the Transformations window (named based on the objects you selected), click Create. In the New Transformation dialog box, enter a name, and click Create.
The Transformation Editor displays. It looks and functions much like the Transformation Editor does when enum types aren't selected, with several differences:
Instead of Input and Output tabs on each side of the transformation, you see the enums and their enum items to map individually.
No expression editor icon is shown, because simple expressions aren’t allowed in enum transformations.
- Configure the transformation by dragging and dropping enum items to map source and target fields. For example, you might convert X_1 from IntEnum to ONE from StringEnum. Note that you can’t create transformations between enum items.
- Click Save to save the transformation. You can also click Save As to create a new transformation. If needed, click Apply to apply the transformation you created to the data association.Process validates the new transformation, displaying a green transformation icon if valid, or a red transformation icon and error if invalid.