Reusable transformations
In a single Compose project there may be several processes that require similar data transformations. For example a reusable transformation can be defined that concatenates first and last names. This transformation could then be used both in the Customers mapping and in the Employees mapping.
As opposed to stored functions or procedures which are environment dependent, reusable transformations are environment agnostic, meaning that not only can they be used as required within a Compose project, but they can also be used across different environments (using Compose’s export/import function).
Centrally managed transformations increase efficiency by eliminating unnecessary duplication, while at the same time, enabling the seamless propagation of changes to all transformation instances.
Adding a reusable transformation
To define a reusable transformation:
-
From the drop-down menu in the top right of the Storage Zone panel, select Reusable Transformations.
The Reusable Transformations window opens.
The window is split into the following panes:
- Upper pane - Lists the reusable transformations that have been defined.
- Lower pane - Provides additional information about transformation instances such as where they are in use (e.g. mappings, metadata, etc.) and the expression that was created using the transformation.
Select a transformation to see the additional information.
-
Click the New Transformation toolbar button.
The New Transformation window opens.
- In the Name field, specify a name for the transformation.
-
In the Category field, specify a category name. If the category name already exists it will be displayed below the field when you start to type the name. To group the new transformation in the same category, simply select the existing name (unless of course you wish to create a new category with a similar name).
In the Expression Builder, transformations are grouped according to their category name, making it easier to find the transformation you want to use. Therefore, when specifying a category name, it is recommended to choose a name that reflects the purpose of the transformation. For example, if you create several transformations that concatenate data, it would make sense to group those transformations under a category called "Join".
-
To add a parameter to the transformation, click the New button to the right of the Parameters heading.
A new row is added to the Parameters list.
-
Specify a name for the parameter, select an appropriate data type, and optionally provide a description.
Information noteIf you add multiple parameters, you can change a parameter’s position by selecting the parameter and then using the Up/Down arrows (above the Parameters list) to reposition it.
-
Click the Create Expression button below the Parameters list.
The Edit Transformation window opens.
-
In the Edit Transformation window, create an expression using the parameters you defined earlier.
For information on creating expressions, see Creating transformations.
-
Click OK to save the transformation.
The transformation is added to the list in the upper pane.
Once a transformation has been defined, it will be available for selection as needed in the Expression Builder’s Transformations tab.
For information on creating expressions, see Creating transformations.
Managing reusable transformations
You can manage reusable transformation as described in the table below.
To | Do This |
Delete a transformation |
Select the transformation and then click the Delete toolbar button. When prompted to confirm the action, click OK. Information note
If the transformation is in use, you first need to delete the transformation instances. |
Edit a transformation |
Double-click the transformation or select the transformation and then click the Edit toolbar button. Continue as described in Reusable transformations. Information note
Any changes you make to a transformation will be propagated to all instances of that transformation. |
Edit a parameter |
Open the Edit Transformation window as described in Reusable transformations. Then, select the parameter you want to delete and click the Delete button above the Parameters list. |