Reacting to changes in the context

After some usage of Camunda/BPMN processes in our organization, we came to a point of reevaluation. We’ve been using user tasks to signal to users what they have done/need to do (automatically opening/closing these tasks), based on the data that they have entered somewhere (which data ends up in the Camunda context). I’ve already asked about indirectly managing user tasks in here, but here’s an overview of our current modelling style:

As we’re not directly using a worklist, we don’t benefit much from using user tasks. On the contrary, modelling is quite cumbersome. What I’m wondering if whether we could use/create a reusable block that would better fit our needs - a block that is always active (eg “Some task”), that gets reevaluated every time the context of the process is updated. This would allow us to store the current “task” state (whether it is completed or not) and if that changes during the reevaluation - emit that change to the users/clients. Ideally this reusable clock will accept as input the conditions under which the task is completed/not. It sounds like DMN might fit this use case, but I’m not certain how exactly.

We’re looking for suggestions for the general direction of a potential solution, and if that is at all possible.

One solution I’m thinking of is roughly the following:

  • upon correlating a message to the engine, get which processes were affected
  • iterate over these processes, find their active “user” tasks
  • somehow re-trigger the conditions passed to the task, so that I can determine if it changes its status or not

It seems more obvious that user tasks are not the right fit in here. Does anyone have a suggestion what direction to try and explore more - DMN tasks (can they be “re-triggered”?) or perhaps a service task (can a manual execute be called for a delegate? as it will have access to the context and can re-evaluate itself?).

Bumping the topic. It’s important for us, as achieving the described behaviour is one of our main reasons for using Camunda.

So, there are actually a lot of options you have to try to achieve what you’re looking for. From the model you first posted I get the impression that you haven’t had a deep dive into BPMN.

Camunda’s features and abilities are always best revealed when you’ve taken time to fully understand what you can do with BPMN.
In your case i’d suggest looking at how the event subprocess works and I think thats one of the best constructions to help you deal with the dynamic nature of what your requirements are.

1 Like

@Niall I don’t consider myself a BPMN expert, by any means, but I’d say I have some experience and that we are actively using event subprocesses.
But back to my example, how do you see it working out? We can listen for Some event that modified the context in an event subprocess and then what? Say that Some task is considered complete when “X, Y and Z” variables are present in the context. How will that task (Some task) be re-evaluated so that we know whether to complete it or not? If you can share a sketched model, that would be much appreciated.