Designers > K2 Designer for Visual Studio > Design Tools > Toolbox > Working with Rules > K2 Line Rule Introduction | Send feedback |
The line rule is the logical navigation system that determines the route within the process to follow as the process executes. For this navigation to function, the rule is configured with line rule logic. The logic is simply a condition or conditions under which the line rule evaluates to true. These set of conditions translate into business logic, directing the workflow process to the appropriate destination users updating data silos and finally completing the Business Process successfully.
In this way, line rules determine which activities are performed and need to encapsulate the business logic used to manage the workflow.
To view the line rule you need a line on your design canvas. Right click on the line and select Properties.
The line rule works as a comparison operator and depending on the outcome of the comparison the rule will either evaluate to true or false. When the line rule evaluates to true, the rule executes. So when False the line does not execute.
When considering the Line Rule user dialog, all the rules listed contribute to the line rule i.e. they are the parameters that enable the line rule to execute. |
A comparison operator compares a known value to an unknown value to establish if they are the same. Usually the First variable is provided by the default Activity and presents the unknown to the line rule. The line rule then compares that value with predetermined values to evaluate the existing line rule expressions.
Composing the line rule parameters poses the question of where to obtain the data to perform the comparison. The line rule can evaluate data from a number of sources which can be viewed from the data browser.
Since the line rule directs the flow of the process from one Default Activity to the next, the conditions or parameters used by the rule are generated as a result of the events taking place within the Activity. The Activity therefore will either populate a data field or provide an outcome that the line rule can use.
If there is no compelling reason for a customized Line Rule, it is not required to configure one. If no expressions appears in the Line Rule list, the Rule will automatically resolve to true |
The Line Rule dialog can be accessed by right-clicking the line and selecting Properties. Then select the Line Rule icon.
Fig. 1. Line Rule Dialog
The Add command opens up the Add Rule parameters dialog. The dialog is used to compose a line rule expression. The Add / Edit rule dialog is used to compose expressions for when there is only one rule or more than one. When there is more than one expression per line rule, the expressions can be evaluated against each other to determine whether the Line Rule will evaluate to true.
As demonstrated above the Add / Edit rule dialog enables the user to compose an expression that will determine the flow of a process.
If there is no compelling reason for a customized Line Rule, it is not required to configure one. If no expressions appears in the Line Rule list, the Rule will automatically resolve to true. |