PowerCenter - Mapping Link

Card Puncher Data Processing

About

Page about Mapping Link

Snippet

Below are some sample java code to generate links connection.

This snippets work with the sample LinkExpression class from the Design API Sdk Sample.

PortLinkContextFactory

By Position

// From the linkFields
Vector<Field> linkFields = getLinkFields();
PortLinkContext portLinkContext = PortLinkContextFactory.getPortLinkContextByPosition( linkFields );
InputSet linkInputSet = new InputSet( dsqRS, portLinkContext );

By Name

// Work only if all ports are present in the two sides (for all port, no filter)
Vector<Field> linkFields = getLinkFields();
PortLinkContext portLinkContext = PortLinkContextFactory.getPortLinkContextByName(linkFields);
InputSet linkInputSet = new InputSet( dsqRS, portLinkContext );

By Map

 
Vector<Field> linkFields = getLinkFields();
Map<Field, Field> linkMap = new LinkedHashMap<Field, Field>();
System.out.println("LinkMap:");
Iterator<Field> myOutPutFieldIterartor = linkFields.iterator();
while (myOutPutFieldIterartor.hasNext()) {
    Field ToField = myOutPutFieldIterartor.next();
    System.out.print("   - ToField:"+ToField.getName());
    Field FromField = dsqRS.getField(ToField.getName());
    System.out.println(" -> FromField:"+FromField.getName());
    linkMap.put(FromField,ToField);
}
PortLinkContext portLinkContext = PortLinkContextFactory.getPortLinkContextByMap(linkMap);
InputSet linkInputSet = new InputSet( dsqRS, portLinkContext );

PortPropagationContextFactory

Exclude Columns

// excluded fields
String[] arrCols = {"BirthDate", "TitelOfCourtesy", "HireDate", "Address", "City", "Region", "PostalCode"};
PortPropagationContext myPortPropagationContext =  
    PortPropagationContextFactory.getContextForExcludeColsFromAll(arrCols);
InputSet linkInputSet = new InputSet( dsqRS, myPortPropagationContext );





Discover More
Powercenter Mapping Pass Through
PowerCenter - Mapping

Mapping depict the flow of data between source and targets. A Pass-Through mapping inserts all the source rows into the target. To create and edit mappings, you use the Mapping Designer tool in the...



Share this page:
Follow us:
Task Runner