Routing Out By Condition
The work item routing is determined by set of conditional statements that can reference any property within the simulation via the Formula Editor input. This makes for a very powerful feature that can route work items with a high level of flexibility.
Selecting the Routing Out By Condition method
To route a work item depending on its condition select By Condition from the Discipline menu in the Routing Out properties window (applicable at a Start Point, Activity or Conveyor). By default, the Routing Out By Condition properties will appear. If you wish to edit this information in the future, you can select Detail next to the By Condition radio button.
Setting the Properties
In the Route Out By Condition properties, you must set a condition for each Destination that work items can be routed out to. In each condition you can use the ellipsis button (denoted ‘…’) to open the Formula Editor, enabling you to reference any property within the simulation in the conditional statement. The Conditional Operators that can be used are available from the dropdown list and include:
- CONTAINS – used to specify a list or range of values. Lists of values are separated with commas ‘,’ and ranges are signified with a dash ‘-‘. In this way it is possible to input multiple ranges as a list by separating the ranges with commas
- < Less Than
- < = Less Than or Equal To
- = Equal To
- > = Greater Than or Equal To
- > Greater Than
- <> Not Equal To
The Destination column displays any simulation objects that are linked after routing out and indicates the order in which the conditional statements are checked. The work item will take the route for the first statement that is met. The order of these statements is controlled from the previous Routing Out From dialog by reordering the routes using the up and down pointing hand icons.
In the image above, the primary conditional statement checks whether the current Simulation Time is less than 120 minutes and routes work items to Queue 2 if true (NOTE - the time unit used here is set via the option in Clock Properties). Once this statement is not true upon routing out, the second conditional statement will be checked. Here we see that the remaining routes are based on the work item label value for ‘lblSize’. Queue 3 will take any work items with a size less than 10, Queue 4 will take sizes of 11, 13, 14 and 15 (utilizing the list and range inputs via the CONTAINS conditional operator) and Queue 5 will then take any other sizes greater than 10.
Adding Multiple Conditions
As part of 2018 the ability to add multiple conditions to each route was added. This allows complex IF statements to be developed by adding AND/OR statements to each condition, adding more power to this feature. To add an additional condition select the add button, located on the right hand side.
This will create an additional row and a dropdown, use the dropdown to select AND/OR. Selecting AND will check if the primary condition AND the secondary condition are true, only if they are both true will the work item be sent down that route. Selecting OR will check if the primary condition OR the secondary condition are true, meaning if either of those conditions are true the work item will be sent down that route.
In the image above, the previous example has been expanded to include multiple conditions. The primary conditional statement now checks whether the current Simulation Time is less than 120 minutes AND if the number of work items in Queue 2 is less than 5. Only when both of these statement are true will work items be sent to Queue 2. Once this statement is not true upon routing out, the second conditional statement will be checked. Queue 3 will now be the chosen destination for work items when lblSize is less than 10 OR when the number of work items in Queue 2 is greater than 5.
Use Default Route Out allows any work items that do not match the above conditions to be given a destination. In the above example, there is no condition for a lblSize value of 10. Selecting Use Default Route Out will then allow for a destination to be chosen in this case.