I am trying to implement the following case, in the context of a simple “restaurant” example:
the user can notify that “a customer has arrived” (this user event has repetition enabled, without any rule)
when the event occurs, my only stage in the case is enabled; it also has repetition enabled
in the stage, there are “Take order” and a “Prepare food” human tasks; I have a sentry on “Prepare food”, to enforce a sequence between the tasks
I expected, using the flowable ui, to be able to click several times on the “A customer has arrived button” and to see a “Take order” task appear in my list every time. That works. I expected that when clicking on completing ONE of the “Take order” task, then ONLY ONE of the “Prepare food” tasks would be activated. This is not the case: as soon as I complete one task, ALL of the “Prepare food” tasks are enabled and appear in my inbox.
Is this the expected behavior?
If yes, what is the proper way to model my case? I am playing the idea of using a “Case Task” instead of a stage, but that would make the modeling/diagrams cumbersome.
Thank you for your answer. I am on 6.7.0 and this morning, I also tried with the Flowable Trial and observed the same behavior. The CMMN was in the original post, but I try once again.
Cheers,
I was able to implement my use case, by using a “Process Task” instead of a stage. However, as stated in my first post, one drawback of this solution is that I HAVE TO split the model in several parts (one diagram for the high-level view with references to repeated elements, another diagram for each repeated element).
I am trying to understand 1) if the CMMN 1.1 is complete and with regards to sentries WITHIN repeated stages and 2) if that is the case, if Flowable supports it.
After a debugging session, I am under the impression that the CMMN engine evaluates the sentry “onPart” using the planItem, and not the planItemInstance. In other words, the transition occurs as soon as ONE of the planItemInstances (one of the “task A” instances) completes. I did not find anything that makes it clear what the CMMN specification expects, so this might be a blank spot? I did not find anything in the flowable docs either.
I have a solution that seems to work, but I would be very keen to get your feedback on whether I am doing completely wrong or sub-optimal here.
What I did was remove the onPart on my Sentry (because it is essentially useless if I repeat the enclosing stage). But I have added an ifPart, with the following expression:
In other words, to enable task_do_that, I wait until task_do_this IN THE SAME STAGE has completed.
I find it strange that I cannot use stages to reason about scopes, but it is what I think is happening here… Am I missing anything? If my solution is acceptable, then it makes the diagram not so easy to read (of course, I could keep the onPart so have a visual line between do_this and do_that, but…).