0% found this document useful (0 votes)
217 views13 pages

Creating Multiple Mappings From One Informatica Mapping Template

Create a single Mapping Template using Informatica Mapping Architect for Visio. Import into PowerCenter to generate multiple mappings and workflows.

Uploaded by

manoharreddy_g
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
217 views13 pages

Creating Multiple Mappings From One Informatica Mapping Template

Create a single Mapping Template using Informatica Mapping Architect for Visio. Import into PowerCenter to generate multiple mappings and workflows.

Uploaded by

manoharreddy_g
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

Creating Multiple Mappings from One Informatica Mapping Template

2009 Informatica Corporation

Abstract
You can create a single mapping template using Informatica Mapping Architect for Visio and import into PowerCenter to generate multiple mappings and workflows.

Table of Contents
Overview ........................................................................................................................................................................... 2 Step 1. Establish the PowerCenter Environment (Developer) .......................................................................................... 3 Designate a Repository Folder to Store the Mapping Objects ..................................................................................... 3 Create Flat File Sources............................................................................................................................................... 3 Create Source and Target Definitions .......................................................................................................................... 4 Step 2. Create and Configure the Mapping Template XML File in Microsoft Visio (Business Analyst) ............................ 4 Create Mapping Template Drawing File ....................................................................................................................... 4 Configure Parameters .................................................................................................................................................. 8 Validate and Publish the Mapping Template ................................................................................................................ 8 Step 3. Save the Mapping Template XML File to a Shared Location (Business Analyst) ................................................ 8 Step 4. Import the Mapping Template XML File to Generate Multiple Mappings and Workflows (Developer) ................. 8 Import the Mapping Template....................................................................................................................................... 9 Specify the Mapping Details ......................................................................................................................................... 9 Generate Mappings .................................................................................................................................................... 10 Generate Workflows from the Mappings .................................................................................................................... 12 Run the Workflows ..................................................................................................................................................... 13

Overview
PowerCenter Mapping Architect for Visio enables the following individuals to collaborate when creating PowerCenter mappings: Business analyst. Creates a high level data flow pattern by designing a mapping template in Microsoft Visio, and defines mapping rules and parameters that may be used to configure and run sessions in PowerCenter. A business analyst is familiar with project requirements and source and target data, but is not a PowerCenter user. PowerCenter developer. Imports the mapping template using the Designer to generate PowerCenter mapping objects. The PowerCenter developer edits the mappings, implements additional functionality that might be required, and runs workflows generated from the mappings. The example in this article shows how to create a mapping template using Informatica Mapping Architect for Visio, and import it into PowerCenter to generate multiple mappings and workflows. In this example, you create a mapping template that represents a simple mapping with an Expression transformation configured to trim leading and trailing spaces from string data. You create two mappings from a single mapping template. Each mapping uses a different source and target table. When you configure the source and target definitions in the mapping template, you can set the value of the source and target to a parameter. After you create the template and import it into PowerCenter, you define the mappings you want to create. When you define the mappings, you set the value of the parameter for the source table in each mapping to a source table in the repository. Similarly, you set the value of the parameter for the target table in each mapping to a target table in the repository.

For more information about PowerCenter Mapping Architect for Visio, see the PowerCenter Mapping Architect for Visio Guide. The example in this article configures two mappings that read from the following flat file sources: CUSTOMER. Flat file source that stores customer data. PRODUCTS. Flat file source that stores product information. The mappings write to the following flat file targets: T_CUSTOMER. Flat file target that stores customer data. T_PRODUCTS. Flat file target that stores product information. To generate the example mappings and workflows, the business analyst and PowerCenter developer collaborate to complete the following tasks: 1. 2. 3. 4. 5. Establish the PowerCenter environment (Developer). The PowerCenter developer creates the source and target tables and designates a repository folder to store the imported objects. Create the mapping template in Microsoft Visio (Business Analyst). The business analyst creates a mapping template drawing file and defines mapping rules and parameters. Validate and publish the mapping to generate the mapping template XML file (Business Analyst). Save the mapping template XML file to a shared location (Business Analyst). Import the mapping template XML file in PowerCenter to generate multiple mappings and workflows (Developer). Use Import Mapping Template Wizard to import the mapping template XML file in PowerCenter Designer and generate mappings and workflows.

Step 1. Establish the PowerCenter Environment (Developer)


Before the business analyst creates a mapping template, the PowerCenter developer completes the following tasks to establish the PowerCenter environment: Designate a repository folder to store the mapping objects. Create flat file sources. Create source and target definitions.

Designate a Repository Folder to Store the Mapping Objects


The PowerCenter developer uses the Repository Manager to select an existing folder or to create a folder for managing the PowerCenter objects that are created or imported. For example, you can create a repository folder, SALES to store the mapping objects you create. For more information about managing repository folders, see the PowerCenter Repository Guide.

Create Flat File Sources


To use the source tables included in this article, create the following text files: Customer.txt and Products.txt in a local directory of the client machine. Create Customer.txt file and enter values in the following format:
CUST_ID, NAME, COMPANY, ADDRESS, CITY, STATE, ZIPCODE 1001, John Baer , Kauai Dive Shoppe , 4-976 Sugarloaf Hwy , Kauai, HI , 94766 1002, Jason Wood , Sight Diver, 1 Neptune Lane, Santa Barbara , CA, 97215

Create Products.txt file and enter values in the following format:


ITEM_ID, ITEM_NAME, DESCRIPTION, PRICE 1245, Compass , Small instrument , 50 1235, Flashlight , tools , 20 1234, Safety knife , tools , 72

Save the text files to the default source file directory in the following location:
INFA_ROOT\server\infa_shared\SrcFiles

Create Source and Target Definitions


After you create the flat files, complete the following tasks: 1. 2. Import source definitions to the repository. Use the Flat File Import Wizard in the PowerCenter Designer to import the text files you created in the repository. Create target definitions from the source definitions. To create a flat file target definition, drag the flat file source definition into the Target Designer workspace. The target definition you create matches the source definition.

For more information about working with flat files, see PowerCenter Designer Guide.

Step 2. Create and Configure the Mapping Template XML File in Microsoft Visio (Business Analyst)
The business analyst completes the following tasks to configure the mapping template XML file in Microsoft Visio: 1. 2. 3. Create a mapping template drawing file. Configure parameters. Validate and publish the mapping template.

Create Mapping Template Drawing File


A mapping template represents a drawing of a mapping in Visio. You can specify rules in a mapping template to specify the extraction logic. Specify parameters in a mapping template to set different values for each mapping object. After you create the template and import it into PowerCenter, you can specify a value for each parameter that you created. To create a mapping template drawing file: 1. 2. Start Mapping Architect for Visio. When you start Mapping Architect for Visio, Visio displays a security warning about viruses in macros. Click Enable Macros to enable the macros for Mapping Architect for Visio.

The following figure shows the Mapping Architect for Visio window:

Informatica Toolbar

Drawing Window

Informatica Stencil

3. 4.

Verify that the Informatica Stencil and Informatica toolbar are available. Select and drag the following mapping objects into the drawing window to create a mapping: Source definition Source Qualifier transformation Expression transformation Target definition

5. 6.

Double-click the source definition to edit the properties. Set the following parameters for the source name:
Property Value

Transformation Name Source Table

$SRC$ $SRC$

Specify parameters when you want to vary the values for a mapping object. 7. Double-click the Source Qualifier transformation to edit the properties.
Property Value

Transformation Name Source Table 8.

SQ_$SRC$ SQ_$SRC$

Double-click the link between the source and the source qualifier.

The Link Rules dialog box appears.

9.

To specify a link rule, enter a value for the Rule Set Name. For example, enter All.

10. Click New Rule and configure the AllPorts rule to connect all ports in the source to all the ports in the source qualifier. 11. Double-click the Expression transformation, and select Properties to specify a value for the transformation name. For example, enter EXP_TRIMSTRINGS. 12. In the Expression transformation, select Configuration to configure an expression that trims leading and trailing spaces in a string. Enter the following values:
Property Value

Port Name Datatype Precision Scale Expression PortName

%ALL%_Out String 0 0 LTRIM(RTRIM ( %ALL% ) ) Output

13. Configure a link rule set named String to pass all columns of string datatype from the source qualifier to the Expression transformation. 14. Double-click the target definition to edit the properties. Set following parameters for the target name.
Property Value

Transformation Name Source Table

$TGT$ $TGT$

15. Configure a link rule set named Remaining from the source qualifier to the target. Create two link rules to pass all ports except ports of string datatype.

16. Configure a link rule set named All to pass all columns ending with _Out in the Expression transformation to the target.

17. Click Save to save the mapping template drawing file. The following figure shows the mapping template drawing file, TrimMapping.vsd

Configure Parameters
You can view and configure the parameters you created in the mapping template file. Configure parameters to generate multiple mappings that use the same data extraction logic but use different sources and targets. To view and configure the mapping template parameters, click the Show Parameters icon on the Informatica toolbar. Configure following values for the source and target parameters:
Property Target Source

Name Label Name Control Control Data

$TGT$ Target Combo Box Targets

$SRC$ Source Combo Box Sources

Validate and Publish the Mapping Template


After you create the mapping template drawing file, verify that the mapping template is valid and identify errors in the mapping configuration object. To validate a mapping template, click the Validate Mapping Template button on the Informatica toolbar. After you validate the mapping template drawing, you can publish it. When you publish it, Mapping Architect for Visio creates the mapping template XML file and the mapping template parameter file that you can use to generate mappings in the repository. To publish a mapping template, click the Publish Template button on the Informatica toolbar.

Step 3. Save the Mapping Template XML File to a Shared Location (Business Analyst)
The business analyst saves the mapping template XML file named TrimMapping.xml to a shared location so that the PowerCenter developer can access the file.

Step 4. Import the Mapping Template XML File to Generate Multiple Mappings and Workflows (Developer)
The PowerCenter developer uses the Import Mapping Template Wizard in the Designer to generate mappings and workflows from the mapping template XML file. To generate the mappings and workflows, the PowerCenter developer completes the following tasks: 1. 2. 3. 4. 5. Import the mapping template. Specify the mapping details. Generate the mappings in the repository. Generate workflows from the mappings. Run the workflows.

Import the Mapping Template


Use the Import Mapping Template Wizard to import the mapping template XML file. To start the Import Mapping Template Wizard: 1. 2. 3. Open the Designer and connect to the repository. Open the repository folder that contains the source and target definitions that you want to use in the mappings. In the Mapping Designer, select Mapping > Import Mapping Template Wizard. The Import Mapping Template Wizard appears.

4. 5.

Click Browse to locate the mapping template XML file. Navigate to the directory where the XML file is located. Select the XML file and click OK. Click Next. The second page of the Import Mapping Template Wizard appears.

Specify the Mapping Details


In the second page of the Import Mapping Template Wizard, you can specify the mapping name for each mapping you want to create. You can also assign the sources and targets that you want to use to generate the mappings. To specify the mapping details: 1. 2. 3. 4. 5. In the second page of the Import Mapping Template Wizard, click the Add button. In the Mapping Name field, enter the mapping name m_CUSTOMER. Optionally, enter a description. Select the target named T_CUSTOMER. Select the source named CUSTOMER.

6.

Repeat steps 1 to 5 to configure the mapping m_PRODUCTS.

7.

Click Next. The third page of the Import Mapping Template Wizard appears. The Import Mapping Template Wizard displays the list of mappings you configured.

Generate Mappings
In the third page of the Import Mapping Template Wizard, you generate mappings and save parameter values. To generate the mappings: 1. In the third page of the Import Mapping Template Wizard, select the mappings that you want to generate: m_CUSTOMER and m_PRODUCTS.

10

2.

Optionally, select Save parameter values for the selected mapping if you want to reuse the mapping template parameter file. The wizard saves the parameter values for each mapping that you selected in the mapping template parameter file.

3. 4. 5. 6.

Click Next. The wizard prompts you to export table definitions. Click Yes. The Export Object dialog box appears, and the table definitions are exported to the default location. Click Close to close the Export Objects dialog box. The fourth page of the Import Mapping Template Wizard appears. Review the list of mappings to verify that the Import Mapping Template Wizard generated the correct number of mappings. By default, the option to create workflows and sessions is enabled.

11

7.

Click Next to launch the Workflow Generation Wizard.

Generate Workflows from the Mappings


The Workflow Generation Wizard allows you to configure the properties for the sessions and workflows you are creating. To use the Workflow Generation Wizard: 1. 2. 3. 4. 5. 6. Select Workflow with Non-Reusable Session. Click Next. Specify the Integration Service, connection settings, and the workflow and session name prefix. To edit the filename for a flat file, edit the file name in the connection object field. Click Next. Edit values for following fields: Workflow Name, Session Name, and Integration Service.

12

7.

Click the configure button to configure connection settings.

8. 9.

Click OK to return to the Wizard. Click Next.

10. Review the status and click Finish. 11. Click Repository > Save.

Run the Workflows


To view the generated mappings, drag the mappings you created into the Mapping Designer workspace. To run the workflows: 1. 2. 3. In the Workflow Manager, click Workflows > Start Workflow. Use the Workflow Monitor to monitor the workflow run. Review the contents of the target table located in $INFA_ROOT\server\infa_shared\TGTFiles

Authors
Lalitha Sundaramurthy Senior Product Manager

Shilpa Jutur Technical Writer

13

You might also like