Cancellation in a process

For this, I believe you just need not put the checkbox to validate the cancellation in task 5, and also not include the XOR gateway after task 5.

William Robert Alves

I would like to achieve this using the “AND Split” as I found it suitable. However, my preference is to allow cancellation from Task 1 to Task 4. After that, Task 5 should be executed. In this case, due to the “AND Split,” how can we resolve it so that Task 5 is executed, and the process ends?
Could we not do it this way? Currently, I have the same solution as the user GotnOGuts. Thank you, GotnOGuts.

Sorry my bro… but I don’t understand very well…

What is “AND Split”?
:thinking:

William Robert Alves

Sorry I meant the paralel gateway.

Is there any posibility to do it?

Bro I thought about the possibilities, and I couldn’t think of anything that could be done for what you need other than the solutions already proposed here earlier.

Without the help of “message events” and the power of code, we are very limited with the possibilities. :neutral_face:

William Robert Alves

Thank you very much, thank you for your help. I also thought about it for quite a while, then I would choose the solution from the second picture, take what is on top.

Hello @GotnOGuts

The version of camunda 8 that he uses does not support conditional events.
That’s why I didn’t use it in my modeling example.

William Robert Alves

Hello, I have a question. I believe you showed me something about conditional events in a previous question. I want to try to make it so that if someone is either in Task D or in Task E, the Task Cancel disappears. Is this possible or is something missing in the process? I thought about using a different boundary, but I’m not sure if it will work that way. I would like to understand the events that are not supported in Camunda 8 during execution.

Hello my friend @FC_Catalonia !
My knowledge in Camunda 8 is still limited…

In Camunda 7 I would do it this way as I did below:

In task D and task E I would create a Local variable for example “cancelSkip” with the value “true”, and in the conditional event of “Cancel task” I would validate to check if the cancelSkip variable exists, or if the cancelSkip variable has the value true, so when the condition is met, the token will automatically leave the user task, no longer allowing the process to end abruptly.

Count on me my friend! :rocket::smiley:

William Robert Alves

Am I understanding correctly that in tasks D and E, the variable is always set to true? Is the variable also visible in the form because I do not want the variable to be in the form of tasks D or E? Did you have to write code in the condition of task cancel, and how does it remove the token before task cancel because I am very interested in that? Could this process be solved using a different boundary event, just as a question?

The ideal would actually be to create the variable before reaching task D or task E.

Because when Camunda verifies that this variable was created, it would activate the conditional event, removing the token from the cancel task and thus not allowing the process to be canceled from this point on.

This variable can be defined at the end of task C, or if Camunda 8 allows this, it can be done on the exclusive gateway as well (in Camunda 7 we can do this using execution listner).

In task c, would you need to store the value as an output? How would you have solved it in Camunda 7? I mean with the execution listener. What you did cannot be done in Camunda 8 in a similar way.

In camunda 7, for example, I could create an execution listner “end” in task C, doing an execution.setVariableLocal(“skipCancel”, true); … or
execution.setVariable(“skipCancel”, true);

and in the conditional event I would place validation to check if the variable skipCancel == true.


But this is just an example of one of the ways we can do it in Camunda 7.

William Robert Alves

Could I see how to do it in Camunda 7? As I can see, you don’t have to write any code. Are there perhaps alternatives in Camunda 8 on how to do it, where you could, if necessary, program it with a boundary event?

Could I perhaps see some screenshots of how it would be entered in Camunda 7?

Hello my friend!
Of course, I will soon create an example of how it can be done in Camunda 7, all directly through Camunda, using as little code as possible.

I just can’t do it now, as I have some priorities here at the company, but as soon as possible I will do it and send it here for you!

Hello my friend!

I apologize for taking so long to respond, but today has been a very busy day at the company.

Below is the model of how you could do it in Camunda 7 to obtain the expected result.
Very simply, and just with expressions!

In task D and task E, you must create an “execution listner (start)” to place the expression ${execution.setVariable("skipCancel", true)}

With this, as soon as your instance reaches one of these tasks, the variable skipCancel will be created with the value true.

And in your conditional event, you will put in “condition” the name of the variable you want to evaluate the condition and the time at which you want the condition to be evaluated, in this case I put “create” to be evaluated only when this variable is created, but you could put “update” if you want each change in the value of the variable to be evaluated again.

And in the type field, choose the type “expression” and write the expression:
${skipCancel == true}

This will cause your instance’s token to leave the task and it will no longer be possible to cancel the process.

And within your user task, you must create a form, so that the user can confirm when he wants to end the process abruptly.

Here my simple process model example to you:

fc_catalonia_process_example.bpmn (10.8 KB)

I hope this helps bro!

William Robert Alves

I understand everything now. It’s a pity that it’s not supported in the latest version of Camunda. Just one question: where is the variable skipCancel created? Is it at the end of Task C, and should I write “skipCancel=true” as the output in Task C? Thank you. That is very clear.

Hello my friend.

In this model, instead of creating the variable “skipCancel” at the output of task C, I created it at the beginning of task D and the beginning of task E.

But it could be done at the exit (“end”) of task C.
:smile:

William Robert Alves