Question

I need a workflow with human tasks, where each node can be revisited at any point of execution.

          /A1 -- B1 \
         /           \
 Start - AND          AND - End
         \            /
          \ A1 --- B2/

So even if the current execution is at B2, the user can go to A1 (assuming A1 is assigned to the same user and is already done).

How can I model this behavior in jBPM/Activiti - since the task once completed is deleted from the execution chain?

Is there any other workflow engine which allows me to do this?

Was it helpful?

Solution

I'm afraid this is difficult to achieve because BPMN is intentionally stateless.

Let's suppose you're at End and want to return to A1. It means that the process token somehow teleports to A1, flows to B1, to the second AND and... we're stuck here. As far as I understand, AND means a BPMN parallel gateway. And it does not allow us to go further because it needs two input tokens at once to produce an output token.

Probably you can adapt another approach, called a Finite State Machine. Imagine that your document (piece of content, token, et cetera) which flows through the workflow has a state attribute, which can be one of several values: Start, A1, etc. Besides this, you have a transition table of the following format:

from  | to
----------
Start | AND
AND   | A1
AND   | A2

Thus, your system knows that AND follows Start. This table does not actually specify a classical finite state machine because it defines a non-functional relation; in other words, any state may be followed from two or more states as it is shown on your diagram. It's up to you how to implement this. Maybe you can create two copies of the instance, or use a combined state attribute which is a list of values.

But anyway, in this approach, 1) the system knows how to swith states automatically; 2) you can build a UI to switch them manually.

The choice of workflow/state machine libraries if you choose to use them depends on your platform, programming langauge, and requirements.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top