Restart a User Task pattern

Hi,

How to model a pattern to restart a User Task per need?
I want to user to interact with it and restart it.
Have a “restart” button in the html form? And then what? Trigger the API? Trigger an exception boundary event?

Thanks

What would it mean for the user to “restart a task” would it clear the data? assign a new user?

Start over like the initial assignment. Clearing data for sure.

Well, couldn’t the front end just reload the task instead of making the process do it?

Well, to be honest, this User Task sends some instruction to a machine/robot, so there’s no “front end”.
I want to “fake” the restart somehow through the Tasklist, so instructions are being sent to the machine again.

Is there any reason why you’re using a User Task for what seems should be a service task?

Big story short, the service task would send the instructions and then move the workflow to what? Now, with the User Task, I achieve the “waiting state” until the robot sends back that it finished its job.
I have also used the “Send/Receive” tasks pattern, but at the moment the User tasks works fine for me :wink:

Well unless it’s too late - would suggest that you consider using the External Task pattern - it’s much better suited for what you’re trying to achieve.

But if it’s too late for that - you can restart your task via the REST API by using the process instance modification call. https://docs.camunda.org/manual/7.9/reference/rest/modification/post-modification-sync/

You can use it to “cancel” the current token and creating a new one at the start of the task you’re currently at.

Thanks Niall, I’ll have a look on the modification API.
I guess I can somehow make a user interface on the user task form to call this API :wink: