Rollback to the previous activity on retry action

I have an incident in a receive task and I want to execute the previous service task when the retry action is performed.
Can I roll back and execute the previous service task on the retry action using transaction or similar things?

Hi @A-medDMK

you could use a Error boundary Event on your receive task to catch your error . Than this error boundary event could restart your service task. See my model.
`

Does ist help?

Best regards,

Markus

Hi @Markus, I dont want to restart my service task automaticaly, I want a manuel rollback by the user when an incident created in the receive task.
Thanks for the reply !

Hi @A-medDMK

Are we talking about an admin user than you could use instance modification in case of incident.

https://docs.camunda.org/manual/7.8/user-guide/process-engine/process-instance-modification/

Best regards,

markus

Yes ! I already try it but the problem her is to override the retry action to restart the execution from the service task and not the reveive task, because the variable in the receive task will reproduce the error and that can lead to infinity loop error. So we need to change the variable that throwed the error (the variable can only be changed in the service task) and exactly when the retry action performed.

With instance modification you will move your token to the service task and you are able to set or update every variable you want.

I dont think it is easy possible to override retry of JobEntity.

How does this look programmatically?