This operator can be used to route the elements in the stream to different further processing operators, depending on the predicate. The elements for which no predicate evaluates to true are send to the last + 1 output port.
Parameter
predicates
: A list of predicatesoverlappingPredicates
: If set to true, all predicates are evaluated and for each predicate evaluated to true, the element will be send. Default is false and will only send the element when the first element evaluates to true.sendingHeartbeats
: If an element is routed to an output, heartbeats will be send to all other outputs. Default is false.
Example
Route Operator
output = route({predicates=['price < 200', 'price < 300', 'price < 400']}, input) /// elements with price < 200 are in 0:output /// elements with price < 300 are in 1:output /// elements with price < 400 are in 2:output /// All other elements are in 3:output