Hello,
I had the question whether it is possible to skip a user task so that it is displayed as completed. In my search I found the following post: How to skip a task?
According to this post and the post linked in it, it is possible to skip a task by using the process instance modification API to complete the task. But this is not possible from within the same process instance. Alternatively, you can implement a SkipExecutionListener.
My question now is how can I call these options as an end user or make them available to the end user? How is the corresponding code triggered by the end user? Do I have to implement a separate button in each task that can be skipped or how can I make it possible for any user task to be skipped by the user?
This largely depends on the concept of “skipping a user task” in your application.
You can use the processInstanceModification API… or allow the user to “complete” the task without doing anything to it… just doing the “claim and complete”.
But as for the best way to implement it… if you have an exclusive interface to interact with your Camunda, for example a webapp, you can provide a button on your platform to call this API… or you can even create a custom API that performs the command you want, interacting with Camunda’s APIs.
If you want to do this directly from the camunda cockpit, you may have 2 options:
Create a custom plugin for the cockpit as a button to skip the task.
Make a workaround using an event subprocess, with a user task just to set a variable “userTaskEvent” true or something similar to initialize the event subprocess… and this stays in a loop in another user task so that you can use a form and inform when you want to skip a user task.
When you click skip on the form of this subprocess user task and complete this task, you will call the modifcation API or something similar to execute what you want.
Although I didn’t put it in the modeling, because I did it very quickly as an example, you can also use a “terminate event” to “kill” the subprocess instance when its main process finishes… or something similar to this.
NOTE: I have never done anything in the way I modeled, and as I also don’t fully know the needs of your business, I don’t know if this would work to solve your problem… but you can test it