How to Develop a Mapping
Develop a mapping to read, transform, and write data according to your business needs.
To develop and run a mapping, perform the following tasks:
- 1. Determine the type of mapping that you want to create.
- 2. Create input, output, and reusable objects such as the reusable transformations and mapplets that you want to use in the mapping.
You can use physical data objects, logical data objects, or virtual tables for mapping input and output.
- 3. Create the mapping.
- 4. Add objects to the mapping. You must add input and output objects to the mapping. Optionally, add transformations and mapplets.
- 5. Link ports between mapping objects to create a flow of data from sources to targets, through mapplets and transformations that add, remove, or modify data along this flow.
- 6. Validate the mapping to identify errors.
- 7. Save the mapping to the Model repository.
- 8. Run the mapping to see the mapping output.
Creating a Mapping
Create a mapping to move data between sources and targets and transform the data.
1. Select a project or folder in the Object Explorer view.
2. Click File > New > Mapping.
3. Enter a mapping name.
4. Click Finish.
An empty mapping appears in the editor.
Adding Objects to a Mapping
Add objects to a mapping to determine the data flow between sources and targets.
- •Drag a data object to the editor and select Read to add the data object as a source.
- •Drag a data object to the editor and select Write to add the data object as a target.
- •To add a Lookup transformation, drag a flat file data object, logical data object, reference table, or relational data object to the editor and select Lookup.
- •To add a reusable transformation, drag the transformation from the Transformations folder in the Object Explorer view to the editor.
Repeat this step for each reusable transformation that you want to add.
- •To add a non-reusable transformation, select the transformation on the Transformation palette and drag it to the editor.
Repeat this step for each non-reusable transformation that you want to add.
- •Configure ports and properties for each non-reusable transformation.
- •Optionally, drag a mapplet to the editor.
Connecting Mapping Objects
Complete a mapping by connecting the mapping objects. You connect mapping objects through the ports. Data passes into and out of a transformation through input ports, output ports, and input/output ports.
When you add an object to a mapping, you connect the properties according to how you want the Data Integration Service to transform the data. The editor displays mapping objects in the following ways:
- •Iconized. Shows an icon of the object with the object name.
The following image shows a mapping with iconized objects:
- •Normal. Shows the columns and the input and output port indicators. You can connect objects that are in the normal view.
The following image shows the preceding iconized mapping in normal view:
When you link ports between input objects, transformations, mapplets, and output objects, you can create the following types of links:
- •One to one links. Link one port in an input object to one port in an output object.
- •One to many links. Link one port to multiple output objects. You can also link multiple ports in one object to multiple output objects.
You can manually link ports or link ports automatically:
- •Manually linking ports. You can manually link one port or multiple ports. Drag a port from an input object to the port of an output object.
- •Automatically linking ports. When you link ports automatically, you can link by position or by name.
For more information about linking ports, see the Developer Transformation Guide.
Creating Target Load Order Constraints
Target load order constraints restrict the order that the Data Integration Service loads rows to target tables in the same mapping. Create target load order constraints on the Load Order tab of a mapping.
1. Click inside the editor.
The mapping Properties tabs appear in the bottom window.
2. Click the Load Order tab.
The following image shows the Load Order tab:
The image shows three constraints. Each constraint contains the primary target and the secondary target. The constraints specify that the Data Integration Service must load the Customer_Master target before the Customer_Orders target. The Sales_Rep_Master must load before the Customer_Orders target. The Sales_Office_Master must load before the Sales_Rep_Master.
3. To enter a constraint, click the New button.
The Developer tool creates a row for the constraint.
4. Click the Primary field.
A list of the target instances in the mapping appears.
5. Select the target instance that you want to load first.
6. In the Secondary field, select the target instance to load second.
You can enter the constraints in any order. You could enter the following pairs of constraints to indicate the same restrictions as in the previous image:
Primary | Secondary |
---|
Sales_Office_Master | Sales_Rep_Master |
Sales_Rep_Master | Customer_Master |
Customer_Master | Customer_Orders |
7. Enter as many constraints as you need.
Validating a Mapping
Validate a mapping to ensure that the Data Integration Service can read and process the entire mapping.
1. Right-click the mapping and select Validate.
Errors appear in the Validation Log view.
2. Fix errors and validate the mapping again.
Running a Mapping
Run a mapping to move output from sources to targets and transform data.
If the domain includes more than one Data Integration Service and you have not selected a default service, the Developer tool prompts you to select one when you preview data or run a mapping.
Right-click the mapping in the editor or the Object Explorer view and click Run Mapping. The Data Integration Service runs the mapping and writes the output to the target.
When the Data Integration Service is configured to use operating system profiles, it runs the mapping with the operating system profile.