Developer Transformation Guide > Joiner Transformation > Port Selectors in a Joiner Transformation
  

Port Selectors in a Joiner Transformation

When the Joiner transformation has generated ports, you need to configure a join condition that is valid when the transformation has different generated ports at run time.
For example, a dynamic mapping includes a Joiner transformation with the following Join condition:
CustomerID = CustomerNo
CustomerID is a generated port in the Joiner transformation. Since the mapping has a dynamic source, the mapping can run with several different source file formats. The column that contains the customer number has a different name in each source file: CustomerID, CustomerNum, or CustNO.
You can create a port selector in the Joiner transformation to accommodate the different customer column names from the dynamic source. Configure a port selector with a selection rule that includes any port name with the prefix "Cust."
Then, configure the Join condition to include the port selector name instead of the CustomerID column name:
Customer_PortSelector = CustomerNo
The join condition is valid with any port name that starts with "Cust."
A port selector can have one or more ports in it. The join condition can include multiple ports if the master group and the detail group in the join condition contain the same number of ports.

Selection Rules

When you configure a port selector, you define selection rules to determine which generated ports to include. The selection rules are similar to the input rules that you can configure for dynamic ports.
A port selector can include ports or generated ports. Configure a port selector on the Port Selector tab.
The following image shows the Port Selector tab:
The image shows a Port Selector column with two port selector names: Master_Cust_Selector and Detail_Cust_selector. The Master is selected. The selection rules include a rule to search by a prefix "Cust". A second rule is by name. The port name is called FullName. The Preview Panel shows 2 ports: CustomerID and FullName.
Configure the following properties for a port selector:
Name
Identifies the port selector. You can create multiple port selectors in a transformation and reference them in expressions.
Scope
Identifies a group of ports that the port selector applies to. Choose a Master or a Detail scope.
Selection Rules
Determines the ports to include in the port selector. When you create the selection rules, the Port Preview panel shows the ports that qualify from the current input ports. These ports might change. Configure the selection rules to accommodate ports from different sources.
You can create selection rules based on the following criteria:
Operator
Includes or excludes the ports that selection rules return. Default is include. You must include ports before you can exclude ports.
Selection Criteria
The type of selection rule you want to create. You can create a rule based on the port type or the column name. To include ports based on the column name, search for specific names or search for a pattern of characters in the name.
Detail
The values to apply to the selection criteria. If the selection criteria is by column name, configure the string or name to search for. If the selection criteria is by port type, select the port types to include.
The following table describes the selection criteria and how to specify the details for the criteria:
Selection Criteria
Description
Detail
All
Includes all ports.
No details required.
Name
Filters ports based on the port name.
Select the port names from a list of values or use a parameter of type Port or Port List.
Type
Filters ports based on the data type of each port.
Select data types from a list.
Pattern
Filters ports by a string of characters in the name or by a regular expression.
Choose prefix, suffix, or regular expression as the pattern type for the port name. Then, enter a value for the pattern or use a parameter of type String.

Creating a Port Selector

Create a port selector to determine which ports to use in a dynamic expression, a lookup condition, or a joiner condition.
    1. Click the Port Selectors tab.
    2. In the Port Selectors area, click New.
    The Developer tool creates a port selector with a default selection rule that includes all ports.
    3. In the Port Selectors area, change the port selector name to a unique name.
    4. If you are working on the Joiner transformation or the Lookup transformation, choose the scope.
    The available ports change based on the group of ports that you choose.
    5. In the Selection Rules area, select an Operator.
    6. Choose the Selection Criteria.
    The following image shows the Port Selector tab:
    The port selector tab shows a port selector called Join_Selector. The scope is Detail, which is the Detail input group of a Joiner transformation. The Operator is Include. The Selection Criteria is By Pattern. The Detail column says prefix: City. The Port preview column shows City and City2 ports.
    7. Click the Detail column.
    The Input Rule Detail dialog box appears.
    8. Select the values to filter ports by.
    The Port Preview area shows the ports in the port selector as you configure the rules.
    9. To reorder the ports in the port selector, select Reorder generated ports according to the input rule order.