tutorial 1: simple parameterized mapping - informatica click on the field mapping tab. we need to...

16
© 1993-2015 Informatica Corporation. No part of this document may be reproduced or transmitted in any form, by any means (electronic, photocopying, recording or otherwise) without prior consent of Informatica Corporation. All other company and product names may be trade names or trademarks of their respective owners and/or copyrighted materials of such owners. Tutorial 1: Simple Parameterized Mapping

Upload: dobao

Post on 13-May-2018

225 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Tutorial 1: Simple Parameterized Mapping - Informatica click on the Field Mapping tab. We need to configure a parameter that defines the field map to the target. In most cases, the

© 1993-2015 Informatica Corporation. No part of this document may be reproduced or transmitted in any form, by any means (electronic, photocopying, recording or otherwise) without prior consent of Informatica Corporation. All other company and product names may be trade names or trademarks of their respective owners and/or copyrighted materials of such owners.

Tutorial 1: Simple Parameterized Mapping

Page 2: Tutorial 1: Simple Parameterized Mapping - Informatica click on the Field Mapping tab. We need to configure a parameter that defines the field map to the target. In most cases, the

2

Table of Contents Introduction ...................................................................................................................................... 3 Prerequisites .................................................................................................................................... 3 Creation of Tasks............................................................................................................................. 7 Creating Mapping Configuration Tasks ......................................................................................... 10 Task Creation for Items ................................................................................................................. 11 Task Creation for Customers ......................................................................................................... 14

Definition .................................................................................................................................... 14 Sources ...................................................................................................................................... 15 Targets ....................................................................................................................................... 15 Other Parameters....................................................................................................................... 16

Summary ....................................................................................................................................... 16

Page 3: Tutorial 1: Simple Parameterized Mapping - Informatica click on the Field Mapping tab. We need to configure a parameter that defines the field map to the target. In most cases, the

3

Introduction This tutorial explains how to build a simple parameterized mapping using Informatica Cloud Mapping Designer (CMD). Informatica Cloud lets you create custom data flows using mappings. A mapping could be concrete, meaning you define all actual objects and data transformations in it, or it could be parameterized. Parameterized mappings are also called templates. In a parameterized mapping the objects and transformations in the mapping are parameterized. User can provide inputs to the configuration points inside the mapping at runtime. The following scenarios are examples where parameterized mappings are valuable : 1. You want to define the overall data flow pattern but want to apply it over physical objects in

a user’s environment and using the relevant customizations applicable in that environment. 2. Bulk creation of data integration tasks that use similar patterns but work on different

objects. 3. Embedding data integration where your app can invoke the data flows while letting users

interact with your UI.

Prerequisites 1. Register to Informatica Cloud if you haven’t already done so, and log in 2. Install and set up a Secure Agent. 3. Create a flat file connection. 4. Make sure you have access to Design->Mappings. If you don’t see this option contact your

Informatica representative.

5. Click on Mappings, and then on New Mapping…

The New Mapping dialog appears. 6. Enter a name such as MySimpleMapping, and enter a description.

Page 4: Tutorial 1: Simple Parameterized Mapping - Informatica click on the Field Mapping tab. We need to configure a parameter that defines the field map to the target. In most cases, the

4

7. Click OK. The Cloud Mapping Designer canvas appears. Ignore the red Invalid indicator for now.

Now the next few steps describe how to use this canvas to create a simple parameterized mapping. This involves dragging and dropping various objects from the left panel and configuring them.

8. First, drag and drop a Source from the left on to the canvas.

9. Now click on the Name property at the bottom half of the page, and change that to

MySource. 10. Enter a description.

Page 5: Tutorial 1: Simple Parameterized Mapping - Informatica click on the Field Mapping tab. We need to configure a parameter that defines the field map to the target. In most cases, the

5

11. Now drag and drop a Target. Click on the Name property and change it.

12. Any transformations that we want to perform as part of the data flow will happen between

these two. This is where we can have aggregation of data, look-up additional data, join data from any additional sources we might bring in, and so on. For now, we will add a simple filter, and link all these, by extending lines from left to right from the arrow icon to the right of those objects.

Page 6: Tutorial 1: Simple Parameterized Mapping - Informatica click on the Field Mapping tab. We need to configure a parameter that defines the field map to the target. In most cases, the

6

With this, we have the basic skeletal mapping. This is an abstract mapping, because we haven’t defined any physical connection or object names yet. In fact we are not going to specify any of those here, as this is a parameterized mapping. It defines only the data flow; the actual objects over which this data flow is to be applied are specified later. However this mapping will still be invalid at this point, as we haven’t identified what those objects are or what filter condition the Filter is going to use. As we mentioned in the beginning of the document, you could directly assign names of your objects – Salesforce objects, Oracle tables or even flat files here, or use a parameter if your use case is one where a parameterized mapping is useful.

13. Now to create parameters, click on MySource, and click on Source tab in the properties panel. The following image shows an example.

We need to tell the mapping what connection we are going to use for source, and then what object we will use from that connection. Both could be parameters here.

14. Click on New Parameter, and specify a name for the new parameter as “MySourceConnection”. Enter a description and a display label that will make it easy to recognize this parameter later when the user needs to provide a value.

Page 7: Tutorial 1: Simple Parameterized Mapping - Informatica click on the Field Mapping tab. We need to configure a parameter that defines the field map to the target. In most cases, the

7

15. Click OK. Now in the dropdown for Source Type, select Parameter. Then click New Parameter next to the text for the source object. Provide a name MySourceObject and also the label/description as you prefer. Click OK.

Creation of Tasks Now we have configured the source parameters. In a similar way configure the target parameters. The following image shows a sample:

Now click on the Field Mapping tab. We need to configure a parameter that defines the field map to the target. In most cases, the source field set may have fields or names different from the target field set. Moreover it’s common to add more fields in the data flow. Parameterizing the field map lets the user configure it using the fields from the user’s environment, which can include additional custom fields etc.

Page 8: Tutorial 1: Simple Parameterized Mapping - Informatica click on the Field Mapping tab. We need to configure a parameter that defines the field map to the target. In most cases, the

8

In the drop down for Field Map Options, choose Completely Parameterized, and then click New Parameter button that shows up. Use MyFieldMap as the parameter name and use label and description as you prefer.

Now you must configure the filter. You can configure even the filter condition as a parameter. Click on the Filter object at the middle of the data flow above, click the property Filter in the bottom panel.

Page 9: Tutorial 1: Simple Parameterized Mapping - Informatica click on the Field Mapping tab. We need to configure a parameter that defines the field map to the target. In most cases, the

9

Click on the drop-down for Filter Condition and select Completely Parameterized. Click New Parameter and configure it using the name MyFilter.

Now we have defined the parameters involved. Click on the drop down for Save and select Save and Continue. Now it should save the mapping and it should also change the status on the top right as Valid.

Page 10: Tutorial 1: Simple Parameterized Mapping - Informatica click on the Field Mapping tab. We need to configure a parameter that defines the field map to the target. In most cases, the

10

If it doesn’t show the status as valid, click on the Validate icon ( ) on top right and see the details of the error. At this point it will mostly likely be a missing parameter. Correct that and revalidate the mapping so it is valid. Click Save and Continue again.

Creating Mapping Configuration Tasks Now we have a parameterized mapping. To illustrate one use case let’s create a couple of tasks for this mapping. The type of tasks/apps we will use is Apps->Mapping Configuration. For this illustration let’s use two flat files as sources. File 1: Items

File 2: Customers

Since this illustration is about a simple mapping that just reads the data from a source, filters some records using a condition and writes to a target, we will use similar-looking target files. However as it is common in many scenarios, the names of the fields are different between the source and target in both these cases. Output file1: Item Output

Page 11: Tutorial 1: Simple Parameterized Mapping - Informatica click on the Field Mapping tab. We need to configure a parameter that defines the field map to the target. In most cases, the

11

Output file2: Customer Output

Now when we create a task for items we want to use the corresponding source and target objects, a field map and a filter condition that works with that file. Similarly when we create a task for customers we will need to use those specific objects and fields. However, the data flow in use is the same for both.

Task Creation for Items Go to Apps > Mapping Configuration. Select New. It will bring up a wizard. On the first page specify a name for the task (“MCT_Items”), and select the Secure Agent you have configured. Leave the Task Based On radio button to Mapping, and select the mapping we created above for the next value.

Click Next. The Sources page will show up. Select the connection that points to the folder containing the input files above here, and select the file “ItemInput.txt” from the drop down.

Page 12: Tutorial 1: Simple Parameterized Mapping - Informatica click on the Field Mapping tab. We need to configure a parameter that defines the field map to the target. In most cases, the

12

Click Next. This will show the Targets page. Select target connection and file similarly.

Click Next to go the Other Parameters page. Initially it shows only the names of the parameters.

Page 13: Tutorial 1: Simple Parameterized Mapping - Informatica click on the Field Mapping tab. We need to configure a parameter that defines the field map to the target. In most cases, the

13

Click on New next to the Filter Condition parameter. It will launch a dialog that you can use to configure a filter condition. Let’s filter out records that are not for Maintenance.

After you click OK, the field map control will also be shown. Drag and drop fields from left to right to map those.

Click Validate. Based on which environment you are using you might get a message that says “The validation service is currently unavailable…”. That is fine. You can go ahead and select the option Save and Run from the Save drop down. That will run this task. The running task will be listed first in the Activity Monitor page, and then in the Activity Log page when it is complete. Upon successful completion it should have written only the maintenance records from the input file to the target file, and skipped any other records.

That completes the illustration for first task, using items. Now you can create another similar task using customers. Use the values shown in the screen shots below.

Page 14: Tutorial 1: Simple Parameterized Mapping - Informatica click on the Field Mapping tab. We need to configure a parameter that defines the field map to the target. In most cases, the

14

Task Creation for Customers

Definition

Page 15: Tutorial 1: Simple Parameterized Mapping - Informatica click on the Field Mapping tab. We need to configure a parameter that defines the field map to the target. In most cases, the

15

Sources

Targets

Page 16: Tutorial 1: Simple Parameterized Mapping - Informatica click on the Field Mapping tab. We need to configure a parameter that defines the field map to the target. In most cases, the

16

Other Parameters

Note that we have used customer-specific objects and values here. Upon successful completion the customer output file should look as below:

Summary This tutorial illustrates how you can create multiple tasks using the same data flow defined in a mapping. Now if any other user has a different version of this file, they can configure it using their fields when use the task wizard. Some other users may want to invoke the ICS API to generate this. There are various ways in which a parameterized mapping can be used. This completes the tutorial. In next tutorials we will see some other common use cases.