K2 blackpoint and K2 blackpearl do not have any activities or events to implement something link if-then-else. But there is a simple way to solve this. We may use line rules for this. Here we see a very simple example:

Our workflow in this example is running with SharePoint integration and the workflow is manually started by the user. In the lines connected to the start activity we have configured rules (Process_Status in the picture is some metadata in our SharePoint list):

Because of that the workflow behaves at this point like an if-then, if-then-else or like a switch-case (that is what we see in the example above). In the example our workflow should go different ways, depending on the metadata or the document or item, the workflow is running on.

And this is the View Flow of our workflow:

But be careful with the line rules. Be sure that at least one line could be passed by the workflow, otherwise it is a dead end and your workflow will never stop.

Inspired by: http://www.k2underground.com/blogs/blackpointtipsandtricks/archive/2009/03/18/actions-outcomes-and-line-rules.aspx

Advertisements