Developer Mapping Guide > Dynamic Mappings > Dynamic Mapping Configuration
  

Dynamic Mapping Configuration

If a source changes, you can configure the Read transformation to accommodate changes. For example, you can configure the transformation to use a different data source or to update the data object based on the data source. If a target changes, you can configure the Write transformation accommodate target changes. For example, you can configure the Write transformation to generate columns based on an associated data object or the mapping flow. If the target is relational, you can create or replace tables at run time.
Configure transformations in a mapping or mapplet to receive and propagate the changes throughout the mapping. Create dynamic ports to receive new or changed columns based on the data flow. A dynamic port generates a port for each incoming column. Configure input rules to determine the columns that a dynamic port receives and to rename or reorder the generated ports.
Create a dynamic expression by using dynamic ports or selection rules in the expressions. When you include a dynamic port, the expression runs against each port that the dynamic port generates. When you include a selection rule, the expression runs against each port in the rule.
When an Expression, Joiner, or Lookup transformation contains generated ports, you can configure port selection rules that accommodate changes to the generated ports when the mapping runs. For example, you need to perform a calculation on sales data, but the sales column name is different for each source. You create a rule to select the correct column to calculate.
You can use parameters to change values at run time. Use parameters to change values such as sources, targets, connections, and rules within the mapping.
Transformations might change in such a way that you cannot create direct links when you design the mapping. If you cannot create links at design time, you can configure run-time links. A run-time link uses a policy or parameter to determine the ports to link between transformation groups at run time.

Dynamic Data Sources

You can configure a mapping to accommodate changes to sources and targets at run time. A dynamic mapping can include flat file and relational data sources. You can use parameters and configure transformation properties based on the types of changes that you expect.
You can configure a mapping to accommodate run-time changes to the following data sources:
Sources
A dynamic source can include relational and flat file sources. Configure the Read transformation and the physical data object to accommodate run-time changes. You can change the source metadata based on the location of the file or source connection, changes to incoming source columns, or the data object.
Targets
A dynamic target can include relational and flat file targets. You can define the target based on the mapping flow or the associated data object. You can also choose to get columns for the data object from the data source. You can use parameters to change run-time properties such as the target data object or the target connection.

Dynamic Mapping Ports and Links

In order to process changes in metadata, you can configure port and link types that a regular mapping does not contain.
The following image shows the ports and links that you can see in a dynamic mapping:
The mapping contains a Read transformation, Sorter transformation, and a Write transformation. The transformations include groups and ports. The Sorter transformation includes a dynamic port and generated ports. The mapping contains links between ports and a run-time link between the groups of Sorter and Write transformations.
  1. 1. Static port (port)
  2. 2. Dynamic port
  3. 3. Generated port
  4. 4. Design-time link (link)
  5. 5. Run-time link
  6. 6. Port Group
Static port (port)
A port that you can create in any type of mapping, dynamic or non-dynamic. Data can pass in to and out of the port and does not contain any dynamic configuration.
Dynamic port
A port in a transformation that can receive one or more columns from an upstream transformation. Dynamic ports can receive new or changed columns based on the metadata that passes through the mapping.
Generated port
A port that represents a single column within a dynamic port. The dynamic port creates a generated port for each column based on the dynamic port rules.
Design-time link (link)
A link that you create to connects ports that propagate data from one transformation to another. You also create these links in a regular mapping.
Run-time link
A link between transformation groups that the Data Integration Service uses to determine which ports to connect at run time based on a policy, a parameter, or both.
Port group
A set of ports in a mapping that represents a row of data. In a dynamic mapping, you can drag a group to a downstream transformation to create a dynamic port.

Dynamic Mapping Rules

Create rules within a dynamic transformation to control the ports that a dynamic port receives and the ports that it generates.
You can configure the following types of dynamic mapping rules:
Input rules
An input rule defines the ports that the dynamic port generates. You can choose to include or exclude ports. You can also choose to rename and reorder the generated ports.
Selection rules and port selectors
Create a selection rule to define the generated ports that the Data Integration Service processes at run time. Create selection rules within a port selector. A port selector contains ports that you can reference in an expression or in a join or lookup condition. You can configure more than one port selector in a transformation based on the metadata changes that you anticipate at run time.

Parameters in Dynamic Mappings

A parameter is a constant value that can change between mapping runs. Use parameters in a dynamic mapping to change sources and targets for flat files or relational resources. You can also use parameters to change the input rules, selection rules, transformation properties, and run-time links.
The following table lists the functionality of parameters that you can create for the dynamic mapping components:
Dynamic Mapping Component
Parameter Functionality
Aggregator transformation
Change the group by port.
Joiner transformation
Change the join condition.
Lookup transformation
Change the lookup condition.
Rank transformation
Change the group by port.
Read transformation
Create parameters to perform the following tasks:
  • - Change the input file name or directory of a flat file source.
  • - Change the connection of a relational source.
  • - Change a flat file data object, customized data object, or a relational data object.
Rules
Create parameters to perform the following tasks:
  • - Change the input rule criteria by name or pattern.
  • - Change the selection rule criteria by name or pattern.
Run-time links
Change the set of ports to link between transformation groups.
Sorter transformation
Change the sort key.
Write transformation
Create parameters to perform the following tasks:
  • - Change the output file name or directory of a flat file target.
  • - Change the connection of a relational target.
  • - Change a flat file data object, customized data object, or a relational data object.