com.informatica.powercenter.sdk.mapfwk.core
Class RouterTransformation

java.lang.Object
  extended by com.informatica.powercenter.sdk.mapfwk.core.Table
      extended by com.informatica.powercenter.sdk.mapfwk.core.Transformation
          extended by com.informatica.powercenter.sdk.mapfwk.core.RouterTransformation
All Implemented Interfaces:
Transform

public class RouterTransformation
extends Transformation

This class implements the Router Transformation. It extends the base Transformation to provide this functionality.

A Router transformation is similar to a Filter transformation because both transformations allow you to use a condition to test data. A Filter transformation tests data for one condition and drops the rows of data that do not meet the condition. However, a Router transformation tests data for one or more conditions and gives you the option to route rows of data that do not meet any of the conditions to a default output group.

A Router transformation is created using an InputSet and one or more TransformGroups. The TransformGroups are user defined output groups which are used in Router transformation. It returns the OutputSet which is collection of RowSets. Each RowSet belongs to each user defind group, it also includes RowSet for default group.

The snippet code shows how to create the Router Transformation,

                //create a Router Transformation using the constructor given below: 
          Mapping mapping = ...; // mapping to which the transform should be added
          Vector vInputSets = ...; // collection of InputSet objects
          Vector vTransformGroup = ...; // the collection of transform groups that are routed  
          TransformationProperties props = ...; // properties           
          RouterTransformation routerTrans = new RouterTransformation( "JoinerTrans", "JoinerTrans", 
                                                  "This is joiner transformation", "JoinerTrans", 
                                                  mapping, vInputSets, vTransformGroup, props );
          
          //apply the transformation
          OutputSet outputSet = routerTrans.apply();
          
          //The router transform returns a set of RowSets. This may be collected using the statement
          //below using a loop.
          for(int i = 0; i < vTransformGroup.length; i++) {
              RowSet outRowSet = (RowSet)outputSet.getRowSets().get(i);
          }
          RowSet outRowSet = (RowSet)outputSet.getRowSets().get(0); 
 


Field Summary
 
Fields inherited from class com.informatica.powercenter.sdk.mapfwk.core.Transformation
m_templateID, m_templateName, m_transformFieldAttr, sessionTransformInst
 
Fields inherited from class com.informatica.powercenter.sdk.mapfwk.core.Table
m_bReusable, m_readOnly
 
Constructor Summary
RouterTransformation()
          Default Constructor
RouterTransformation(java.lang.String name, java.lang.String busName, java.lang.String desc, java.lang.String instName)
          Initialize the object with name, business name, description and instance name.
RouterTransformation(java.lang.String name, java.lang.String busName, java.lang.String desc, java.lang.String instName, Mapping mapping, java.util.Vector vInputSets, java.util.Vector vTransformGroup, TransformationProperties props)
           
 
Method Summary
 OutputSet apply()
          Apply the Transformation.
 void checkFieldNameConflict(java.util.Vector inputSetForNameConflict, Field field, int fieldAppender)
          To check whether field with same name exists or not, if exits then rename it Iterate through the inputSetforNameConflict for name conflict Get an iterator over the fields and iterate over fields If field with same name exits,then find length of fieldAppender by converting it from integer to string Take substring from the field name by extracting fieldAppender Increment the value of fieldAppender Append the incremented value of fieldAppender to substring Set field name to string generated by appending values Again iterate through the input sets to check any other name conflict
protected  OutputSet genOutputSet(java.util.Vector inputSet)
          Generate the OutputSet for a given Vector of InputSet
 
Methods inherited from class com.informatica.powercenter.sdk.mapfwk.core.Transformation
add, addInitProp, defaultDuplicateNameRemovalSchema, getGroupSet, getInitProps, getMapping, getOutFields, getOutputSet, getProperties, getSessionTransformInstanceKeySet, getSessionTransformInstanceProperty, getTemplateID, getTemplateName, getTransContext, getTransformationFieldAttr, getTransformationType, getTransformGroup, setGroupSet, setGroupSet, setMapping, setOutFields, setOutputSet, setReusable, setSessionTransformInstanceProperty, setTemplateIDAndName, setTransContext, setTransformationFieldAttr, setTransformationType, setTransformGroup, standardizeString
 
Methods inherited from class com.informatica.powercenter.sdk.mapfwk.core.Table
addField, addMetaExtension, getBusinessName, getDescription, getField, getFields, getInstanceName, getMetaExtensions, getName, getReferencedField, isReadOnly, isReusable, removeField, removeMetaExtension, setBusinessName, setDescription, setFields, setInstanceName, setMetaExtensions, setMetaExtensionValue, setName, setReadOnly
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RouterTransformation

public RouterTransformation()
Default Constructor


RouterTransformation

public RouterTransformation(java.lang.String name,
                            java.lang.String busName,
                            java.lang.String desc,
                            java.lang.String instName)
Initialize the object with name, business name, description and instance name.

Parameters:
name - name of the table
busName - business name
desc - description
instName - instance name

RouterTransformation

public RouterTransformation(java.lang.String name,
                            java.lang.String busName,
                            java.lang.String desc,
                            java.lang.String instName,
                            Mapping mapping,
                            java.util.Vector vInputSets,
                            java.util.Vector vTransformGroup,
                            TransformationProperties props)
                     throws InvalidTransformationException
Throws:
InvalidTransformationException
Method Detail

checkFieldNameConflict

public void checkFieldNameConflict(java.util.Vector inputSetForNameConflict,
                                   Field field,
                                   int fieldAppender)
To check whether field with same name exists or not, if exits then rename it Iterate through the inputSetforNameConflict for name conflict Get an iterator over the fields and iterate over fields If field with same name exits,then find length of fieldAppender by converting it from integer to string Take substring from the field name by extracting fieldAppender Increment the value of fieldAppender Append the incremented value of fieldAppender to substring Set field name to string generated by appending values Again iterate through the input sets to check any other name conflict

Parameters:
inputSetForNameConflict - Vector of Input sets
field - Field object whose name is to be checked
fieldAppender - Incrementing its value to make name distinct

apply

public OutputSet apply()
                throws InvalidTransformationException
Description copied from interface: Transform
Apply the Transformation.

Returns:
OutputSet object
Throws:
InvalidTransformationException - exception

genOutputSet

protected OutputSet genOutputSet(java.util.Vector inputSet)
Generate the OutputSet for a given Vector of InputSet

Overrides:
genOutputSet in class Transformation
Returns:
OutputSet object