+ All Categories
Home > Documents > 0075-CreatingMappingsfromIMT

0075-CreatingMappingsfromIMT

Date post: 04-Apr-2018
Category:
Upload: manoharreddyg
View: 216 times
Download: 0 times
Share this document with a friend

of 13

Transcript
  • 7/29/2019 0075-CreatingMappingsfromIMT

    1/13

    Creating Multiple Mappings from OneInformatica Mapping Template

    2009 Informatica Corporation

  • 7/29/2019 0075-CreatingMappingsfromIMT

    2/13

    AbstractYou can create a single mapping template using Informatica Mapping Architect for Visio and import into PowerCenterto generate multiple mappings and workflows.

    Table of ContentsOverview...........................................................................................................................................................................2Step 1. Establish the PowerCenter Environment (Developer) .......................................................................................... 3

    Designate a Repository Folder to Store the Mapping Objects .....................................................................................3Create Flat File Sources ............................................................................................................................................... 3Create Source and Target Definitions .......................................................................................................................... 4

    Step 2. Create and Configure the Mapping Template XML File in Microsoft Visio (Business Analyst) ............................4Create Mapping Template Drawing File .......................................................................................................................4Configure Parameters ..................................................................................................................................................8Validate and Publish the Mapping Template................................................................................................................ 8

    Step 3. Save the Mapping Template XML File to a Shared Location (Business Analyst) ................................................ 8Step 4. Import the Mapping Template XML File to Generate Multiple Mappings and Workflows (Developer)................. 8

    Import the Mapping Template....................................................................................................................................... 9Specify the Mapping Details ......................................................................................................................................... 9Generate Mappings.................................................................................................................................................... 10Generate Workflows from the Mappings ....................................................................................................................12Run the Workflows ..................................................................................................................................................... 13

    OverviewPowerCenter Mapping Architect for Visio enables the following individuals to collaborate when creating PowerCentermappings:

    y Business analyst. Creates a high level data flow pattern by designing a mapping template in Microsoft Visio, anddefines mapping rules and parameters that may be used to configure and run sessions in PowerCenter. Abusiness analyst is familiar with project requirements and source and target data, but is not a PowerCenter user.

    y PowerCenter developer. Imports the mapping template using the Designer to generate PowerCenter mappingobjects. The PowerCenter developer edits the mappings, implements additional functionality that might berequired, 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 mappingtemplate that represents a simple mapping with an Expression transformation configured to trim leading and trailingspaces 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 andtarget to a parameter. After you create the template and import it into PowerCenter, you define the mappings you wantto create. When you define the mappings, you set the value of the parameter for the source table in each mapping to asource table in the repository. Similarly, you set the value of the parameter for the target table in each mapping to atarget table in the repository.

    2

  • 7/29/2019 0075-CreatingMappingsfromIMT

    3/13

    For more information about PowerCenter Mapping Architect for Visio, see the PowerCenter Mapping Architect for VisioGuide.

    The example in this article configures two mappings that read from the following flat file sources:

    y CUSTOMER. Flat file source that stores customer data.

    y PRODUCTS. Flat file source that stores product information.

    The mappings write to the following flat file targets:

    y T_CUSTOMER. Flat file target that stores customer data.

    y T_PRODUCTS. Flat file target that stores product information.

    To generate the example mappings and workflows, the business analyst and PowerCenter developer collaborate tocomplete the following tasks:

    1. Establish the PowerCenter environment (Developer). The PowerCenter developer creates the source and targettables and designates a repository folder to store the imported objects.

    2. Create the mapping template in Microsoft Visio (Business Analyst). The business analyst creates a mappingtemplate drawing file and defines mapping rules and parameters.

    3. Validate and publish the mapping to generate the mapping template XML file (Business Analyst).

    4. Save the mapping template XML file to a shared location (Business Analyst).

    5. 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 andgenerate 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 toestablish the PowerCenter environment:

    y Designate a repository folder to store the mapping objects.

    y

    Create flat file sources.y 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 formanaging 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 localdirectory 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

    3

  • 7/29/2019 0075-CreatingMappingsfromIMT

    4/13

    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. Import source definitions to the repository. Use the Flat File Import Wizard in the PowerCenter Designer to importthe text files you created in the repository.

    2. Create target definitions from the source definitions. To create a flat file target definition, drag the flat file sourcedefinition into the Target Designer workspace. The target definition you create matches the source definition.

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

    Step 2. Create and Configure the Mapping Template XML File inMicrosoft Visio (Business Analyst)The business analyst completes the following tasks to configure the mapping template XML file in Microsoft Visio:

    1. Create a mapping template drawing file.

    2. Configure parameters.

    3. 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 youcreated.

    To create a mapping template drawing file:

    1. Start Mapping Architect for Visio.

    2. When you start Mapping Architect for Visio, Visio displays a security warning about viruses in macros. ClickEnable Macros to enable the macros for Mapping Architect for Visio.

    4

  • 7/29/2019 0075-CreatingMappingsfromIMT

    5/13

    The following figure shows the Mapping Architect for Visio window:

    Informatica Toolbar

    Drawin

    3. Verify that the Informatica Stencil and Informatica toolbar are available.

    4. 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.

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

    Property Value

    Transformation Name $SRC$

    Source Table $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 SQ_$SRC$

    Source Table SQ_$SRC$

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

    g Window

    Informatica Stencil

    5

  • 7/29/2019 0075-CreatingMappingsfromIMT

    6/13

    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 sourcequalifier.

    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 trailingspaces in a string.

    Enter the following values:

    Property Value

    Port Name %ALL%_Out

    Datatype String

    Precision 0

    Scale 0

    Expression LTRIM(RTRIM ( %ALL% ) )

    PortName Output

    13. Configure a link rule set named String to pass all columns of string datatype from the source qualifier to theExpression transformation.

    14. Double-click the target definition to edit the properties.

    Set following parameters for the target name.

    Property Value

    Transformation Name $TGT$

    Source Table $TGT$

    6

  • 7/29/2019 0075-CreatingMappingsfromIMT

    7/13

    15. Configure a link rule set named Remaining from the source qualifier to the target. Create two link rules to passall 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

    7

  • 7/29/2019 0075-CreatingMappingsfromIMT

    8/13

    Configure Parameters

    You can view and configure the parameters you created in the mapping template file. Configure parameters togenerate 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 $TGT$ $SRC$

    Label Name Target Source

    Control Combo Box Combo Box

    Control Data Targets 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 themapping 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 Visiocreates the mapping template XML file and the mapping template parameter file that you can use to generatemappings 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 MultipleMappings and Workflows (Developer)The PowerCenter developer uses the Import Mapping Template Wizard in the Designer to generate mappings andworkflows from the mapping template XML file.

    To generate the mappings and workflows, the PowerCenter developer completes the following tasks:

    1. Import the mapping template.

    2. Specify the mapping details.

    3.

    Generate the mappings in the repository.4. Generate workflows from the mappings.

    5. Run the workflows.

    8

  • 7/29/2019 0075-CreatingMappingsfromIMT

    9/13

    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. Open the Designer and connect to the repository.

    2.

    Open the repository folder that contains the source and target definitions that you want to use in the mappings.

    3. In the Mapping Designer, select Mapping > Import Mapping Template Wizard.

    The Import Mapping Template Wizard appears.

    4. 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.

    5. 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 youwant 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. In the second page of the Import Mapping Template Wizard, click the Add button.

    2. In the Mapping Name field, enter the mapping name m_CUSTOMER.

    3. Optionally, enter a description.

    4. Select the target named T_CUSTOMER.

    5. Select the source named CUSTOMER.

    9

  • 7/29/2019 0075-CreatingMappingsfromIMT

    10/13

    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 displaysthe 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

  • 7/29/2019 0075-CreatingMappingsfromIMT

    11/13

    2. Optionally, select Save parameter values for the selected mapping if you want to reuse the mapping templateparameter file.

    The wizard saves the parameter values for each mapping that you selected in the mapping template parameterfile.

    3. Click Next.

    The wizard prompts you to export table definitions.

    4. Click Yes.

    The Export Object dialog box appears, and the table definitions are exported to the default location.

    5. Click Close to close the Export Objects dialog box.

    The fourth page of the Import Mapping Template Wizard appears.

    6. Review the list of mappings to verify that the Import Mapping Template Wizard generated the correct number ofmappings.

    By default, the option to create workflows and sessions is enabled.

    11

  • 7/29/2019 0075-CreatingMappingsfromIMT

    12/13

    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 arecreating.

    To use the Workflow Generation Wizard:

    1. Select Workflow with Non-Reusable Session.

    2. Click Next.

    3. Specify the Integration Service, connection settings, and the workflow and session name prefix.

    4. To edit the filename for a flat file, edit the file name in the connection object field.

    5. Click Next.

    6. Edit values for following fields: Workflow Name, Session Name, and Integration Service.

    12

  • 7/29/2019 0075-CreatingMappingsfromIMT

    13/13

    13

    7. Click the configure button to configure connection settings.

    8. Click OK to return to the Wizard.

    9. 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. In the Workflow Manager, click Workflows > Start Workflow.

    2. Use the Workflow Monitor to monitor the workflow run.

    3. Review the contents of the target table located in $INFA_ROOT\server\infa_shared\TGTFiles

    Authors

    Lalitha SundaramurthySenior Product Manager

    Shilpa JuturTechnical Writer


Recommended