Spring process engine - Re-trigger a task manually

Hi Folks,

I’m using spring boot process engine.
I need your advise for the followeing sceanrio:

I have a service task to send an email. Once successful it moves to next wait state.
I have a scenario where the user who should have received the email says they haven’t received the email. I want to resend them the email.
Question: Is there a way to re-trigger a completed task in the process flow i.e: resend the email as described in the scenario above.

@joram
TIA!

@Tanwar, you can use change state api
https://documentation.flowable.com/latest/assets/core-swagger/bpmn.html#/Process%20Instances/changeActivityState

With this you can move process execution back in history. But remember, if you have some tasks after email task, they will execute again after email is sent.

Also, the forum works on best effort basis. Everyone tries their best to answer the question and help the community. It would be helpful if you don’t tag people directly in the post. It adds unnecessary tension and discourage other participants to answer your question.

Ciao,
Pratham.

I do not use the REST APIs from flowable.
Rather, I use the flowable SDK. Could you pls help with some code snippet to do it programmatically.

Noted the tagging bit. Apologies

See ChangeActivityStateBuilder (Flowable - Engine 6.8.0 API).
e.g.

runtimeService.createChangeActivityStateBuilder()
                .processInstanceId(processInstanceId)
                .moveActivityIdTo("currentId", "toId")
                .changeState();