PowerCenter - Mapping Link

1 - About

Page about Mapping Link

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

3.1 - PortLinkContextFactory

3.1.1 - By Position

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

3.1.2 - 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 );

3.1.3 - 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 );

3.2 - PortPropagationContextFactory

3.2.1 - Exclude Columns

// excluded fields
String[] arrCols = {"BirthDate", "TitelOfCourtesy", "HireDate", "Address", "City", "Region", "PostalCode"};
PortPropagationContext myPortPropagationContext =  
    PortPropagationContextFactory.getContextForExcludeColsFromAll(arrCols);
InputSet linkInputSet = new InputSet( dsqRS, myPortPropagationContext );
dit/powercenter/link.txt ยท Last modified: 2017/09/06 19:56 by gerardnico