Reusable Transformations
Reusable transformations are transformations that you can use in multiple mappings or mapplets.
For example, you might create an Expression transformation that calculates value-added tax for sales in Canada to analyze the cost of doing business in that country. Rather than perform the same work every time, you can create a reusable transformation. When you need to incorporate this transformation into a mapping, you add an instance of it to the mapping. If you change the definition of the transformation, all instances of it inherit the changes.
The Developer tool stores each reusable transformation as metadata separate from any mapping or mapplet that uses the transformation. It stores reusable transformations in a project or folder.
When you add instances of a reusable transformation to mappings, changes you make to the transformation might invalidate the mapping or generate unexpected data.
Reusable Transformation Instances and Inherited Changes
When you add a reusable transformation to a mapping or mapplet, you add an instance of the transformation. The definition of the transformation still exists outside the mapping or mapplet, while an instance of the transformation appears within the mapping or mapplet.
When you change the transformation, instances of the transformation reflect these changes. Instead of updating the same transformation in every mapping that uses it, you can update the reusable transformation one time, and all instances of the transformation inherit the change. Instances inherit changes to ports, expressions, properties, and the name of the transformation.
Editing a Reusable Transformation
When you edit a reusable transformation, all instances of that transformation inherit the changes. Some changes might invalidate the mappings that use the reusable transformation.
You can open the transformation in the editor to edit a reusable transformation. You cannot edit an instance of the transformation in a mapping. However, you can edit the transformation runtime properties.
If you make any of the following changes to a reusable transformation, mappings that use instances of it might not be valid:
- •When you delete one or more ports in a transformation, you disconnect the instance from part or all of the data flow through the mapping.
- •When you change a port datatype, you make it impossible to map data from that port to another port that uses an incompatible datatype.
- •When you change a port name, expressions that refer to the port are no longer valid.
- •When you enter an expression that is not valid in the reusable transformation, mappings that use the transformation are no longer valid. The Data Integration Service cannot run mappings that are not valid.
Editor Views for a Reusable Transformation
You define properties and create Java code for a reusable Java transformation in views in the editor.
For reusable transformations, the following views are available:
- Overview
- Enter the name and description of the transformation, and create and configure input and output ports.
- Advanced
- Set advanced properties for the transformation.