Informatica Powercenter – Mapplets

Here what official documentation says about Mapplets:

A mapplet is a reusable object that you create in the Mapplet Designer. It contains a set of transformations and lets you reuse the transformation logic in multiple mappings.

When you use a mapplet in a mapping, you use an instance of the mapplet. Any change made to the mapplet is inherited by all instances of the mapplet.

My take on this is, if you have a mapping that you wish to re-use, instead of copying and paste every time you need that flow of transformations, you instead create a mapplet, so the next time you don’t need to copy-paste, you just use the mapplet you created.

Another important take on mapplets is that it’s a set, a group, of transformations. What I mean is, if you can achieve your logic just by using only one transformation, then you do not need mapplet, you just create a re-usable transformation. However, if your logic requires more than one transformation, then yes, mapplets is what you are looking for.

Active or Passive

A mapplet can be active or passive depending on the transformations in the mapplet. Active mapplets contain one or more active transformations. Passive mapplets contain only passive transformations.

All transformation rules apply to the mapplet. For example, as with an active transformation, you cannot concatenate data from an active mapplet with a different pipeline.

Rules for creating a Mapplet

Use the following rules and guidelines when you add transformations to a mapplet:

  • If you use a Sequence Generator transformation, you must use a reusable Sequence Generator transformation.
  • If you use a Stored Procedure transformation, you must configure the Stored Procedure Type to be Normal.
  • You cannot include PowerMart 3.5-style LOOKUP functions in a mapplet.

You cannot include the following objects in a mapplet:

  • Normalizer transformations
  • COBOL sources
  • XML Source Qualifier transformations
  • XML sources
  • Target definitions
  • Other mapplets

Best-practice: Although reusable transformations and shortcuts in a mapplet can be used, to protect the validity of the mapplet, use a copy of a transformation instead. Reusable transformations and shortcuts inherit changes to their original transformations. This might invalidate the mapplet and the mappings that use the mapplet.

Creating and Using Mapplet

We create mapplets pretty much the same way we create transformations, with some differences, of course.

where you can access your mappings

One very important difference is that mapplets require input and output. You can create input and output by going transformation -> create -> mapplet input / mapplet output, or you can click on menu bar icons.

An important fact about mapplets is that their input or output ports do not have a datatype definition.

You can create mapplets ports manually, like we did in the image above, or your can drag a source to your mapplet and drag all fields to your input/output and then remove your source from your mapplet.

just drag ports from your source qualifier to your input/output ports
then delete it, and your ports will be ready to go

So, let’s say I want to do some text cleansing, like apply lowercase, remove leading or trailing spaces, if it’s null change to ‘not informed’.

simple mapplet

Testing our mapplet

To test our mapplet we are creating a .csv flat file, and input it’s result to our MS SQL database.

Here’s our source csv file:

And here is our mapping, using our mapplet:

Notice what we did here;

  • we have passed our ID and NAME from source directly to ID and NAME on target,
  • and our cleansed data, the one from our mapplet, receives the same NAME from source but store its result in RESULT_CHECK on target. This way, when we query our database we will be able to see the difference between those two fields.

In your workflow session the mapplets transformation will be shown under transformation group, but named with the mapplet name before the transformation name (yeah, I should have named better my mapplet transformations, ops).

Here’s our result, it worked =)

our mapplet worked!

References

https://youtu.be/m7pGHQd8tLI – Reusable Transformation & Mapplets in Informatica – In depth Knowledge with Real Time Scenarios

https://youtu.be/B7uj_XvGG6M#Informatica #Mapplet Video Tutorial – Part 25 || Informatica #Free #Training Sessions

Publicado por Pedro Carvalho

Apaixonado por análise de dados e Power BI

2 comentários em “Informatica Powercenter – Mapplets

Deixe uma resposta

Preencha os seus dados abaixo ou clique em um ícone para log in:

Logotipo do WordPress.com

Você está comentando utilizando sua conta WordPress.com. Sair /  Alterar )

Imagem do Twitter

Você está comentando utilizando sua conta Twitter. Sair /  Alterar )

Foto do Facebook

Você está comentando utilizando sua conta Facebook. Sair /  Alterar )

Conectando a %s

%d blogueiros gostam disto: