Hi,
I have overridden the execute method in the Command<Object> interface. Please find below my implementation.
@Override
public Object execute(CommandContext commandContext) {
try {
JobEntity job = Context.getCommandContext().getJobEntityManager()
.findJobById(jobId);
log.info("Process instance id = " + job.getProcessInstanceId());
job.setRetries(0);
job.setLockOwner(null);
job.setLockExpirationTime(null);
if (exception != null) {
job.setExceptionMessage(exception.getMessage());
job.setExceptionStacktrace(getExceptionStacktrace());
}
ActivitiEventDispatcher eventDispatcher = commandContext
.getEventDispatcher();
if (eventDispatcher.isEnabled()) {
eventDispatcher.dispatchEvent(ActivitiEventBuilder
.createEntityEvent(ActivitiEventType.ENTITY_UPDATED,
job));
eventDispatcher.dispatchEvent(ActivitiEventBuilder.createEntityEvent(
ActivitiEventType.JOB_RETRIES_DECREMENTED, job));
}
return null;
} catch (Throwable e) {
throw new RuntimeException(e);
}
}
This sets the job retry to zero, but the workflow is not moving forward, it stops at the node where the exception was caught. Please advice, let me know what i am missing. Thanks in advance.