Hello Comnunity ,
While resolving incident in camunda 8 is batch processing possible? In documentation i have found that we have to do retry one by one for each processInstance , but what if we have 1000 or 10000 of processInstances having incident for same Activity(ServiceTask). and we want to retry it in one go?
In camunda 7 we have functionality of batch processing , that we can pass ActivityId , and do retry.
here is the snippet of code that we are currently using in Camunda 7:
public class JobRetriesRequest{
private Integer retries;
private String startedBefore;
private String startedAfter;
private String failedActivityId;
}
import lombok.AllArgsConstructor;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.camunda.bpm.engine.ManagementService;
import org.camunda.bpm.engine.impl.JobQueryImpl;
import org.springframework.stereotype.Service;
@Service
@Slf4j
@AllArgsConstructor
public class IncidentRetryService {
private final ManagementService managementService;
@SneakyThrows
public void setJobRetriesAsyncOperation(JobRetriesRequest jobRetriesRequest) {
try {
JobQueryImpl jobQueryImpl = new JobQueryImpl();
jobQueryImpl.failedActivityId(jobRetriesRequest.getFailedActivityId());
jobQueryImpl.createdAfter(getZonedDateTimeFormat().parse(jobRetriesRequest.getStartedAfter()));
jobQueryImpl.createdBefore(getZonedDateTimeFormat().parse(jobRetriesRequest.getStartedBefore()));
jobQueryImpl.noRetriesLeft();
managementService.setJobRetriesAsync(jobQueryImpl, jobRetriesRequest.getRetries());
} catch (Exception e) {
log.error("Exception in updating job retries", e);
throw e;
}
}
public void executeJobById(String jobId){
managementService.executeJob(jobId);
}
}
There is nothing i am seeing similar in Camunda 8.
Refer these doc: