Conditional Start Rule

In K2 Workflow Designer, you use the Start step to configure how your workflow starts. You can select to start the workflow with a form, a SharePoint event, or from K2 Management. By default, workflows always start when triggered by these methods.

Sometimes you don't want a workflow to start unless it meets certain conditions. In these cases, you use a Conditional Start Rule which allows you to add conditions in a rule to either start or not start the workflow. The Conditional Start Rule evaluates data outside of the workflow and, based on the outcome, either starts the workflow or not.

Keep in mind that the Conditional Start Rule is not a Decision step. This rule cannot determine which path to follow within a workflow or who gets a Task. It only evaluates the condition you set and starts the workflow if the condition is met.

If your Conditional Start Rule is met (condition = true) the workflow starts. If the condition is not met (condition = false) the workflow does not start.

If you start a workflow from a SmartForm and the start condition is not met, a message is shown and nothing further happens. You can find an entry in the server logs stating “The process <name> was not started because the conditional start rule evaluated to false” to show that the workflow instance did not start. This applies to solutions built with K2 Five 5.2 or later. To find the server log go to <install drive>:\Program Files\K2\Host Server.

Here are some examples where you might want to use a conditional start rule:

See the following resources for more information:

Example

An example use of the Conditional Start Rule is that you use SharePoint document libraries to store team documents. You have two libraries called General Documents and Purchase Orders. These two libraries are not integrated with K2 for SharePoint. Purchase orders are supposed to be stored in the Purchase Orders library where Finance keeps them. All other documents are stored in the General Documents library. Sometimes documents end up in the wrong place, with purchase orders stored in the General Document library. In these cases, someone should be notified that documents are in the wrong library.

For this scenario, you want a workflow to start when Purchase Orders are added to the General Documents library. You are not concerned about the other types of documents, just Purchase Orders. The workflow only starts if the condition, set in the rule, is met. In this case, the workflow starts if the Name field contains the words “Purchase Order”.

To configure the rule, select the Conditional Start option in the Start step. You can use information from SmartObjects, references, and variables to configure the rule. You create an IF-THEN-ELSE rule using the Rules Designer.

From the Context Browser, drag Fields, Functions, SmartObjects, or Workflow-related properties to customize the conditional start rule.

Example of a Conditional Start Rule