cancel
Showing results for 
Search instead for 
Did you mean: 

End process after Retries

lastseeds
Champ in-the-making
Champ in-the-making
Hey,
I need to end process after 3 retries. Ive implemented JobRetryCmd like:

  @Override
    public Object execute(CommandContext commandContext) {
       
        JobEntity job = commandContext.getJobEntityManager().findJobById(jobId);

        if (isFirstException(job)) {
            setRetryCount(job);
        }

        if (noMoreRetries(job)) {
            updateStatus(commandContext, job);
           //throw new BpmnError("myError"); //Go to diagram error handler - DOES NOT WORK
        }

        return super.execute(commandContext);
    }

How do I end process after job failed 3 times?This event happens aside from the flow.
The process should never be fired again.
1 REPLY 1

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi,

Just configure and implement new org.activiti.engine.impl.jobexecutor.DefaultFailedJobCommandFactory after 3 retries delete process instance.

Regards
Martin