Reuse me please – reusable transformation

As you are aware, source and targets are reusable components, that is, you work on sources in the Source Analyzer and targets in the Target Designer, respectively. Also, you must be aware that you cannot edit sources and targets in the Mapping Designer, and they can be edited in Source Analyzer and Target Designer, respectively.

Sources and targets are called reusable components because you can use the same source and target in multiple mappings. We can reuse the source or target across multiple mappings only if the metadata requirement of both the mappings is exactly the same. In this case, metadata means the number of columns, their data type, their data size, indexes, constraints, and so on. Even if there are small changes, you cannot reuse the components.

On the same lines, if we have the same logic to implement across multiple mappings, we can use the reusable transformations, which allow us to reuse the same transformation across mappings. You can only reuse the transformation if the metadata requirements in the mappings are exactly the same. Even if there is a small difference, the reusable transformations will not work as there can be mismatch in the processing.

There are two ways in which you can create reusable transformations:

  • Using the Transformation Developer
  • Making existing transformations reusable

Using Transformation Developer

To use Transformation Developer, perform the following steps:

  1. In the designer, navigate to Tools | Transformation.
  2. Click on Transformation | Create.
    Using Transformation Developer
  3. Select the transformation type you wish to create from the list of transformations. We are creating an expression transformation as an example. Click on Create and then click on Done.
    Using Transformation Developer

The transformation will appear on the screen. Also, you will see the transformation added to your navigator under Transformations, as shown in the following screenshot:

Using Transformation Developer

Now, you can drag-and-drop the transformation in the mapping in the Mapping Designer in order to use it as a reusable component.

You will see that you cannot edit the reusable transformation in the Mapping Designer. To edit the reusable transformation, you need to use Transformation Developer.

Making existing transformation reusable

In the earlier section, we saw how to use a new transformation as a reusable transformation. Consider that you already have a transformation that you wish to use in another mapping, but as it is nonreusable, you are not able to do so. To solve this issue, we have an option using which you can make an existing nonreusable transformation reusable. Perform the following steps to do this:

  1. Open the mapping containing the transformation you wish to make reusable in the Mapping Designer. We are using an existing mapping containing an expression transformation in order to make it reusable.
  2. Double-click on the transformation in order to view the properties of the transformation. You will see an option, Make reusable. Click on the box, as shown in the upcoming screenshot.

    A warning message will pop up mentioning that the process is irreversible.

    Making existing transformation reusable

You can see that the transformation is now added under Transformation in the navigator, which indicates that the transformation can be reused; you can reuse this in other mappings too.

Mapplet

In the previous section, we saw how to make a transformation reusable. Going further, you might also like to reuse logic that was implemented using multiple transformations. The group of transformations that can be reused is called as mapplets.

Mapplets can be created in the Mapplet Designer in Informatica PowerCenter Designer. Mapplets allow you to reuse groups of transformations in multiple mappings. As is the case with reusable transformations, in order to use mapplets, the metadata requirements of the mappings should be exactly the same.

You can use the Mapplet Designer to create mapplets with new transformations or use existing transformations.

To create a new mapplet, perform the following steps:

  1. In the designer, navigate to Tools | Mapplet Designer, as shown in the following screenshot. Then, click on Create.
    Mapplet
  2. Specify the name of new mapplet as MPLT_REUSABLE.
  3. Add the transformations in the mapplet as per your logic. We are using filter and expression transformation to create sample logic.
  4. Click on Transformations and create mapplet input and mapplet output and name them MPLT_INPUT and MPLT_OUTPUT, respectively.
  5. Place the mapplet input before the filter and the mapplet output after the expression. These will act as the source and target for the mapplet. Drag-and-drop the columns from the expression transformation to MPLT_OUTPUT and drag-and-drop the columns from filter transformation back to MPLT_INPUT, as shown in the following screenshot:
    Mapplet
  6. Press Ctrl + S to save the mapplet, and you will be able to see the mapplet added under mapplets in the navigator.
  7. You can now drag-and-drop the mapplet in the Mapping Designer in order to use it as reusable components. Drag-and-drop the mapplet into the Mapping Designer and link the columns from the source qualifier to input ports of the mapplet and drag-and-drop the output ports from the mapplet to the Target Designer, as shown in the following screenshot:
    Mapplet

If you wish to reuse the logic that was implemented using multiple transformations in an existing mapping, you can simply copy the existing transformations from the Mapping Designer and paste it in the Mapplet Designer. This is the easiest way to use the existing group of transformations.

As you might have noticed, mapplet serves two purposes—first, it allows you to reuse your existing transformation and second, it makes your mapping look simpler by replacing multiple components with a single component.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset