Académique Documents
Professionnel Documents
Culture Documents
A mapplet is a reusable object that you create in the Mapplet Designer. It contains a set of transformations
(more than 1 transformation) and lets you reuse the transformation logic in multiple mappings.
For example, you a similar logic need to add more than 1 mapping. Like concatenate First_Name &
Last_Name, Address_Street_1 & Address_Street_2 etc and this logic is need for Employee_Table,
Student_Table, Patient_Table 3 mappings.
In this scenario instead of repeating the logic, we can have a mapplet for concatenate (Merge) columns and
use this mapplet instance for the above mentioned 3 mappings.
When you use a mapplet in a mapping, you use an instance of the mapplet. Like a reusable transformation,
any change made to the mapplet is inherited by all instances of the 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. If you want the mapplet to receive data from the
mapping, use an Input transformation to receive source data.
Include multiple transformations. A mapplet can contain as many transformations as you need.
Pass data to multiple transformations. You can create a mapplet to feed data to multiple
transformations. Each Output transformation in a mapplet represents one output group in a mapplet.
To use a mapplet in a mapping, first we need to configure it for input and output. In addition to
transformation logic that you configure, a mapplet has the following components:
Mapplet input
Mapplet output
Mapplet ports
Mapplet Input
Mapplet input can originate from a source definition and/or from an Input transformation in the mapplet.
You can create multiple pipelines in a mapplet. Use multiple source definitions and source qualifiers or Input
transformations. You can also use a combination of source definitions and Input transformations.
Mapplet Output
Mapplet Output transformation in a mapplet to pass data through the mapplet into a mapping. A mapplet
must contain at least one Output transformation with at least one connected port in the mapplet. Each
connected port in an Output transformation displays as a mapplet output port in a mapping. Each Output
transformation in a mapplet displays as an output group in a mapping. An output group can pass data to
multiple pipelines in a mapping.
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
beNormal.
Normalizer transformations
COBOL sources
XML Source Qualifier transformations
XML sources
Target definitions
Other mapplets
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.
Step to Create Mapplet:
1. Connect/Open the folder where you want to create mapplet.
2. From Menu click Tools Select Mapplet Designer
5. Select Mapplet Input from drop down and enter a new name for this transformation as mplt_input,
Click on Create and Done.
6. Select mplt_input and double click to edit Go to Ports tab and add port required for it.
8. Select Mapplet Outpu from drop down and enter a new name for this transformation as mplt_output,
Click on Create and Done.
9. Select mplt_output and double click to edit Go to Ports tab and add port required for
it.
13. Select expression and double to edit Ports and Add output ports highlighted below:
14. Click on Full_Name port to open expression editor to concatenate First_Name and Last_Name with
single space.
Do not delete a port from the mapplet. The Designer deletes mapplet ports in the mapping
when you delete links to an Input or Output transformation or when you delete ports connected to an Input
or Output transformation.
Do not change the datatype, precision, or scale of a mapplet port. The datatype, precision,
and scale of a mapplet port is defined by the transformation port to which it is connected in the mapplet.
Therefore, if you edit a mapplet to change the datatype, precision, or scale of a port connected to a port in
an Input or Output transformation, you change the mapplet port.
Do not change the mapplet type. If you remove all active transformations from an active
mapplet, the mapplet becomes passive. If you add an active transformation to a passive mapplet, the
mapplet becomes active.
MAPPLETS
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.
Mapplet Output:
The output of a mapplet is not connected to any target table.
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.
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.