CMMN Planning : setting sequence of execution of the items planned in run-time

We seem to solve the problem with adding plan items based on discretionary items to a plan of a case instance in run-time phase. But several questions still remain unresolved. One of them is how to define an execution sequence of the added items.

It is simple at design phase. For example, if Alice should perform the task after Bob completed his one, we can design something like that:

But when we are in the middle of execution of a case, we have only a discretionary task (which can be assigned to Bob and/or Alice), and we have decided that in the particular situation we need Bob and Alice to complete their tasks in exactly this order. It is possible to add two tasks: one for Bob and another one for Alice. But how to set the sequence? CMMN tells nothing about it.

It seems there are two options:

  1. The logic of the sequence should be controlled by application, and a developer should invent a suitable solution every time.
  2. It should be a part of the process engine which allows to register and control the sequence like this.

What do you think about this?

Hi @mak,

I’m not sure I understand the case entirely. Do you mean that a user may plan a discretionary item twice (once assinged to Alice, once assigned to Bob) and you want to define an order in which they should be executed? Is that what you mean, when you write It is possible to add two tasks: one for Bob and another one for Alice?

By the way: If you already have an implementation of planning for the things that CMMN 1.1 does define, then don’t hesitate to create a pull request already. Even if it is not finished and polished yet, we may give you feedback early on and use this as a basis to design more advanced features.

Cheers,
Thorben

Hi @thorben,

Yes, that’s my point. I can plan discretionary items (discretionary
tasks as well) and assigned the task to performers (using variables). But I
don’t understand the right way how to set the sequence, which the performer
wants to set while planning these tasks. CMMN says nothing about it. I need
your vision if it should be implemented as a part of the engine or not.

I am planning to make a pull request but not now. The
solution is to dirty and it is created as a separate module. I should integrate
it into the engine before.

Hi Dmitry,

Concerning your usecase:
I am very unsure of what you describe with the multiple instances of the task and the sequence. I do not think that the CMMN planning and Discretionary Tasks concepts allow you to create a plan in terms of “these tasks should be performed this many times in this order / sequence”.

Concerning your contribution:
Since this a very complex topic I think that we should move step by step.
What you should start with is create an initial implementation of a single discretionary task that can be added to the plan using a new API method. When we have that on master we can look into more complex cases.

Does that make sense to you?

Best Regards,
Daniel

Hi Daniel,

It makes sense only if we understand in general that

  1. It’s possible technically to implement in Camunda CMMN engine: we need to define sentries for ad-hoc plan items in active case instances.
  2. You will accept such contribution and will merge it in the master trunk of the engine code. This is important for us and we can’t waste resources if you could decline the contribution as not compliant to CMMN 1.1.

Otherwise this doesn’t make sense. Until we are sure that our implementation efforts are aligned with your vision and plans.
Hope you understand.

Hi Sergei,

I totally understand that you want to clarify up front whether you contribution is within the scope of our project or not.
But currently I do not understand what exactly you are trying to contribute.

But please understand that we never give any “guarantees that something will be merged” upfront. No serious open source project does that :slight_smile:.
Yet we will merge and support you to develop a feature that is
a) in conformance with the CMMN specification and the scope of the Camunda project
b) implemented in a way that is in conformance with code quality requirements

This feature

But when we are in the middle of execution of a case, we have only a discretionary task (which can be assigned to Bob and/or Alice), and we have decided that in the particular situation we need Bob and Alice to complete their tasks in exactly this order. It is possible to add two tasks: one for Bob and another one for Alice. But how to set the sequence? CMMN tells nothing about it.

Is not within the scope of CMMN. CMMN discretionary tasks do not allow the user to do create a “plan” in the sense that “these tasks need to be performed by these users in that sequence”.

What you can do is contribute discretionary Tasks as specified in CMMN.

Best Regards,
Daniel