Download as pdf or txt
Download as pdf or txt
You are on page 1of 8

Worklet

Worklets are objects that represent a set of workflow tasks that allow reusing a set of workflow logic in
several windows.

Use of Worklet: - You can bind many of the tasks in one place so that they can easily get identified and
also they can be of a specific purpose.
There are 2 types of worklets in Informatica:
1. Reusable worklet
2. Non reusable worklet

Informatica Reusable Worklet

A work let which can be assigned to multiple work flow is known as reusable work
A reusable work let is created using work let designer tool
A work flow which contains a work let is known as parent work flow
A work flow is a main program where as work let is the subroutine with in the main program.

Non Reusable Worklet in Informatica

A non-reusable worklet is created using work flow designer tool

Creating a Worklet:
1. Open up Informatica PowerCenter Workflow Manager
2. Click on Worklet Designer then the Worklets menu, then Create.

3. A dialog box will open. Go ahead and name your worklet at this point.

4. Next, add and connect tasks to your worklet just as you would a normal workflow.

5. Once you have finished adding tasks, save your worklet.


6. To begin using it within a workflow, open up the Workflow Designer, click on the workflows
menu, and then Create to create a new workflow.
7. Once you see the start task, drag and drop the newly created worklet into the designer and link
them together.

8. Save your work and now you are ready to start your worklet by starting the parent workflow
that contains the worklet.

Mapplet
The Mapplet in Informatica is a very useful feature of Informatica PowerCenter. Just as in many
programming languages, reuse is essential to building fast, efficient software. Mapplets provide these
advantages in the Informatica PowerCenter environment. Mapplets are reusable objects with
transformations and logic very similar to a traditional mapping. The key difference is reuse. When we
want mapping logic to be reusable across other mappings, we should place this logic within a mapplet.
Mapplets help simplify mappings in the following ways:

Include source definitions: Use multiple source definitions and source qualifiers to provide
source data for a mapping.
Accept data from sources in a mapping
Include multiple transformations: As many transformations as we need.
Pass data to multiple transformations: We can create a mapplet to feed data to multiple
transformations. Each Output transformation in a mapplet represents one output group in a
mapplet.
Contain unused ports: We do not have to connect all mapplet input and output ports in a
mapping.

Mapplet Input:
Mapplet input can originate from a source definition and/or from an Input transformation in the
mapplet. We can create multiple pipelines in a mapplet.

We use Mapplet Input transformation to give input to mapplet.


Use of Mapplet Input transformation is optional.

Mapplet Output:
The output of a mapplet is not connected to any target table.

We must use Mapplet Output transformation to store mapplet output.


A mapplet must contain at least one Output transformation with at least one connected port in
the mapplet.

Use of mapplet in mapping:

We can mapplet in mapping by just dragging the mapplet from mapplet folder on left pane as
we drag source and target tables.
When we use the mapplet in a mapping, the mapplet object displays only the ports from the
Input and Output transformations. These are referred to as the mapplet input and mapplet
output ports.
Make sure to give correct connection information in session.

Considerations

Mapplet must have atleast 1 or more output transformations


Mapplet may not require input transformation if source definition & Source Qualifier have
been used in a Mapplet
The following mappings tasks can also be performed on mapplets:
o Set tracing level Copy mapplet
o Export and import mapplets
o Delete mapplets
o Compare mapplets
o Compare instances within a mapplet
o Create shortcuts to mapplets
o Add a description
o View links to a port
o Propagate port attributes
Rules and guidelines when you edit a mapplet that is used by mappings:
o Do not delete a port from the mapplet
o Do not change the datatype, precision, or scale of a mapplet port
o Do not change the mapplet type (Active / Passive)
If a mapplet contains an SQL override, you must connect all mapplet output ports in the
mapping
The PowerCenter Repository Reports has a Mapplets list report that displays list of all
mappings using a particular mapplet.
You can connect an Input transformation to multiple transformations in a mapplet. However,
you cannot connect a single port in the Input transformation to multiple transformations in the
mapplet.
An Input transformation must receive data from a single active source.
A mapplet must contain at least one Input transformation or source definition with at least one
port connected to a transformation in the mapplet.
A mapplet must contain at least one Output transformation with at least one port connected to
another transformation in the mapping.
When a mapplet contains a source qualifier that has an override for the default SQL query, you
must connect all of the source qualifier output ports to the next transformation within the
mapplet.
If the mapplet contains more than one source qualifier, use a Joiner transformation to join the
output into one pipeline. If the mapplet contains only one source qualifier, you must connect
the mapplet output ports to separate pipelines. You cannot use a Joiner transformation to join
the output.
When you edit a mapplet, you might invalidate mappings if you change the mapplet type from
passive to active.
If you delete ports in the mapplet when the mapplet is used in a mapping, you can invalidate
the mapping.
Do not change the datatype, precision, or scale of a mapplet port when the mapplet is used by
a mapping.
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:
o Normalizer transformations
o Cobol sources
o XML Source Qualifier transformations
o XML sources
o Target definitions
o Pre- and post- session stored procedures
o Other mapplets

Example1:
We will join EMP and DEPT table. Then calculate total salary. Give the output to mapplet out
transformation.

EMP and DEPT will be source tables.


Output will be given to transformation Mapplet_Out.

Steps:
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.

Open folder where we want to create the mapping.


Click Tools -> Mapplet Designer.
Click Mapplets-> Create-> Give name. Ex: mplt_example1
Drag EMP and DEPT table.
Use Joiner transformation as described earlier to join them.
Transformation -> Create -> Select Expression for list -> Create -> Done
Pass all ports from joiner to expression and then calculate total salary as described in expression
transformation.
Now Transformation -> Create -> Select Mapplet Out from list > Create -> Give name and then
done.
Pass all ports from expression to Mapplet output.
Mapplet -> Validate
Repository -> Save

Making a mapping:
We will use mplt_example1, and then create a filter transformation to filter records whose Total Salary
is >= 1500.

Mplt_example1 will be source.


Create target table same as Mapplet_out transformation. Creating Mapping

1.
2.
3.
4.
5.

Open folder where we want to create the mapping.


Click Tools -> Mapping Designer.
Click Mapping-> Create-> Give name. Ex: m_mplt_example1
Drag mplt_Example1 and target table.
Transformation -> Create -> Select Filter for list -> Create -> Done.

6. Drag all ports from mplt_example1 to filter and give filter condition.
7. Connect all ports from filter to target. We can add more transformations after filter if needed.
8. Validate mapping and Save it.

Make session and workflow.


Give connection information for mapplet source tables.
Give connection information for target table.
Run workflow and see result.

Reusable Transformation
In a data integration project there are many processes which may share common data transformation
requirements. Deployment of reusable transformation objects in these cases avoids duplication of
metadata, reduces the development time and provides centralized change control.
Once an object is defined as reusable, it can be called in any mapping or mapplet. If we change any
properties of the transformation it will be automatically reflected in all the mappings transformations.
Several types of transformations such as lookups, aggregators, expressions, routers, and sequences can
be defined as reusable objects.

Example:

Navigate

Create

to

any

the

Transformation

Transformation

here

developer

for

in

Informatica

example

an

powercenter

Expression

designer.

transformation

This

can

be

dragged

and

dropped

in

any

mapping

from

the

side

menu:

You might also like