use of org.camunda.bpm.engine.impl.persistence.entity.HistoricIncidentManager in project camunda-bpm-platform by camunda.
the class HistoricBatchEntity method delete.
public void delete() {
HistoricIncidentManager historicIncidentManager = Context.getCommandContext().getHistoricIncidentManager();
historicIncidentManager.deleteHistoricIncidentsByJobDefinitionId(seedJobDefinitionId);
historicIncidentManager.deleteHistoricIncidentsByJobDefinitionId(monitorJobDefinitionId);
historicIncidentManager.deleteHistoricIncidentsByJobDefinitionId(batchJobDefinitionId);
HistoricJobLogManager historicJobLogManager = Context.getCommandContext().getHistoricJobLogManager();
historicJobLogManager.deleteHistoricJobLogsByJobDefinitionId(seedJobDefinitionId);
historicJobLogManager.deleteHistoricJobLogsByJobDefinitionId(monitorJobDefinitionId);
historicJobLogManager.deleteHistoricJobLogsByJobDefinitionId(batchJobDefinitionId);
Context.getCommandContext().getHistoricBatchManager().delete(this);
}
use of org.camunda.bpm.engine.impl.persistence.entity.HistoricIncidentManager in project camunda-bpm-platform by camunda.
the class ManagementServiceTest method deleteJobAndIncidents.
protected void deleteJobAndIncidents(final Job job) {
final List<HistoricIncident> incidents = historyService.createHistoricIncidentQuery().incidentType(Incident.FAILED_JOB_HANDLER_TYPE).list();
CommandExecutor commandExecutor = processEngineConfiguration.getCommandExecutorTxRequired();
commandExecutor.execute(new Command<Void>() {
@Override
public Void execute(CommandContext commandContext) {
((JobEntity) job).delete();
HistoricIncidentManager historicIncidentManager = commandContext.getHistoricIncidentManager();
for (HistoricIncident incident : incidents) {
HistoricIncidentEntity incidentEntity = (HistoricIncidentEntity) incident;
historicIncidentManager.delete(incidentEntity);
}
commandContext.getHistoricJobLogManager().deleteHistoricJobLogByJobId(job.getId());
return null;
}
});
}
use of org.camunda.bpm.engine.impl.persistence.entity.HistoricIncidentManager in project camunda-bpm-platform by camunda.
the class BatchEntity method delete.
public void delete(boolean cascadeToHistory) {
CommandContext commandContext = Context.getCommandContext();
deleteSeedJob();
deleteMonitorJob();
getBatchJobHandler().deleteJobs(this);
JobDefinitionManager jobDefinitionManager = commandContext.getJobDefinitionManager();
jobDefinitionManager.delete(getSeedJobDefinition());
jobDefinitionManager.delete(getMonitorJobDefinition());
jobDefinitionManager.delete(getBatchJobDefinition());
commandContext.getBatchManager().delete(this);
configuration.deleteByteArrayValue();
fireHistoricEndEvent();
if (cascadeToHistory) {
HistoricIncidentManager historicIncidentManager = commandContext.getHistoricIncidentManager();
historicIncidentManager.deleteHistoricIncidentsByJobDefinitionId(seedJobDefinitionId);
historicIncidentManager.deleteHistoricIncidentsByJobDefinitionId(monitorJobDefinitionId);
historicIncidentManager.deleteHistoricIncidentsByJobDefinitionId(batchJobDefinitionId);
HistoricJobLogManager historicJobLogManager = commandContext.getHistoricJobLogManager();
historicJobLogManager.deleteHistoricJobLogsByJobDefinitionId(seedJobDefinitionId);
historicJobLogManager.deleteHistoricJobLogsByJobDefinitionId(monitorJobDefinitionId);
historicJobLogManager.deleteHistoricJobLogsByJobDefinitionId(batchJobDefinitionId);
commandContext.getHistoricBatchManager().deleteHistoricBatchById(id);
}
}
Aggregations