AnsweredAssumed Answered

End process after Retries

Question asked by lastseeds on Aug 26, 2015
Latest reply on Aug 31, 2015 by martin.grofcik
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.

Outcomes