Hi workflow team, we configure the retry mechanism as a global level and creating the incident after 3 retries but one specials case is there when 400 bad request come that time we should not retry and we have to create the incident , for that what we implemented we created the one class where we try to set the retry value
@Override
public Object execute(CommandContext commandContext) {
JobEntity job = Context.getCommandContext()
.getJobManager()
.findJobById(jobId);
if(this.exception.getCause().getMessage().startsWith(“400 Bad Request”)) {
job.setRetries(0);
}
else{
job.setRetries(3);
}
return commandContext;
}
but what we facing whenever 400 come that time it is working fine but apart from 400 it is retrying gain and again means calling same class again and retry value setting again and again means retries is not stopping . is there any way where we can set the retry when 400 come that time retry 0 and 500 or some other exception come that time it should retry 3 times.