Activating a stage on completion of a task in another stage

Hi there, I haven’t found anything on this topic. I’ve been trying to model a simple case and run it in Camunda 7.4.0 that models multiple outcomes of a task, and progresses the case based on the chosen outcome. In the attached screenshot, there’s a stage called Draft where someone can draft an article. The Draft task in there is automatically activated, and is therefore available for the user to pick out of a work list UI. There are multiple outcomes of that task however, with the user able to submit the article for review or just publish it straight away. I tried modelling these outcomes as tasks that are not activated, and therefore simply remain enabled. That way, they don’t appear in the work list UI. If the user chooses to send the article for review, the ‘Submit for Review’ task is activated, and completed. The Draft task is also completed. The intended behaviour is for the Draft stage to auto-complete (which it does), and for the Review stage to be activated (it is set to be automatically activated) based on the ‘Submit for Review’ task being completed.

However, the Review stage does not become active. Its case execution remains available. The only way I’ve got this to work is by connecting the Draft stage (as opposed to the ‘Submit for Review’ task) to the Review stage, with an IfPart on the entry criterion that makes use of a variable whose value is set to ‘Submit for Review’. The application sets that variable based on the user selecting the ‘Submit for Review’ outcome.

My question is: shouldn’t the Review stage in the screenshot be activated by completing the ‘Submit for Review’ task?

While it appears to be a contrived way of modelling the case, I’ve done this because I value the application being able to programmatically determine what outcomes are available, and present a UI to the user that lets the user select the outcome. This way, the application doesn’t have to change if the case definition is remodelled and redeployed by a business user. Also, while the variable solution works, I’d rather use standard CMMN as much as possible, and I thought how I originally modelled it would work.

Hi @dtodonnell,

According to the CMMN 1.1 specification it is correct. If the task “Submit for Review” is completed, then the stage “Review” must be activated. By the way this was not possible with CMMN 1.0.
Due to the fact that the on part connection is crossing the stage boundary, the engine is currently not able to execute this. The plan item referenced by the plan item on part must be contained by the same stage the sentry (criterion) is defined in, see 1. So this is a current limitation of the engine.

Cheers,
Roman

Thanks very much Roman, sorry for not replying sooner.

Would I be right in saying that the difference in the specifications that matters is that in the 1.1 spec, table 8.7, for state Available it has a new clause:

“The Stage or Task has a Sentry with an OnPart that has a sourceRef outside of the enclosing Stage of that Stage or Task and this Sentry is satisfied. In that case, the Stage instance and recursively all Stage instances up to the enclosing Stage of the Stage or Task in which the Stage or Task resides moves into Active state if not already active.”

Is this the key part of the spec in your opinion?

Hi @dtodonnell,

Yes, this the key part.

Cheers,
Roman

Hi Roman,

i have the same problem as dtodonnell.

Can you tell me, whether it would be possible to cross the borders of stages in the onParts with Camunda 7.5?

Thanks for your reply.

Hi.
I’m having the same problem.
My CMMN diagram have 5 stages with 6 milestones “outside” the stages and they do not “occur” when the onParts are completed.
Did you find a solution?

I’m using Camunda server 7.6 and Camunda modeler 1.5.1

Cheers,
André