Router
The Router package filters and routes data to separate tables through defined ports. Router produces multiple outputs produced against distinct rules-based expressions.
Once source entities are added to the canvas, the Router package is brought onto the canvas by double-clicking or dragging the icon. When the square icon becomes a live controller on the canvas, double-click to reveal rule and output port definition panel.
Add Ports by selecting Add Rule and enter names for ports to be created. Create a target entity for each port, a good practice is to append the port name to the target entity name. Connect the outports of the Router controls to the inports of the newly created corresponding target entities.
Rule definition
Select the Expression Builder to create rules defining which output will be routed to the ports (defined in the next step). For more information see Custom Expression Builder.
In this example, the source entity will be filtered on values for the field 'Major', creating target entities routed by field values:
Target Entity |
Where |
Value for Field 'Major' |
|
StudentMajor_Router_a |
Major=='Art' OR Major=='Accounting' |
||
StudentMajor_Router_b |
Major=='Business' OR Major=='Math' |
||
StudentMajor_Router_c |
Major=='Psychology' |
||
StudentMajor_Router_d |
Major=='Music' OR Major=='Biology' |
OUTPUT PORT definition: Ports must be named for Router to validate the dataflows.
Save the dataflow, Validate the package, then Execute the dataload into the target entities. In this example,
Sample data shows output of the four Router operations in this example (located though the discover module):