Router allows you to branch your flow into several routes and process the data within each route differently. Once a Router receives a bundle, it forwards it to each connected route in the order the routes were attached. Routes are processed sequentially, not in parallel. Please note that a bundle is not sent to the next route until it has been completely processed by the previous route.
Click on the "Auto-align" icon to verify the order of the routes, which will arrange the routes according to the order from top to bottom. To change the order, remove the Router module and re-connect the routes in the desired order.
To add a router to a scenario
A Router can be added to a scenario in one of the following ways:
- To connect the Router after a module, click on the module's right "ear" and choose Flow Control> Router from the list of modules.
- If you wish to insert the Router between two modules, click on the wrench icon below the route connecting the two modules (or right-click the route) and choose "Add a router" from the menu.
- A Router can also be inserted automatically in the case when you try to connect module
Bto which another module is already connected. Just drag the left "ear" of the module
Aand drop it on to module
You can place a filter on a route after the Router to filter bundles as on any other route. Simply click on the route, add conditions and click "OK" button to save the filter setup, per below.
The filter setup on a route after a Router contains a special option: the fallback route, per below.
When enabled, this route is used in the case when a bundle cannot continue on from the Router via any other route, as filters on the other routes filtered it out. The Fallback route is distinguished with a different arrow sign inside the Router module, per below.
A typical use case of the fallback route is to continue the flow with route
A if the condition is met and with route
B if it is not. This can be achieved with the following steps:
- Insert a Router in your scenario.
- Connect both routes (
B) to the Router.
- Click on the route
Aand specify a condition, per below image.
Click on the route
Band enable the Fallback route:
Article is closed for comments.