public virtual void delete(bool cascadeToHistory) { CommandContext commandContext = Context.CommandContext; deleteSeedJob(); deleteMonitorJob(); BatchJobHandler.deleteJobs(this); JobDefinitionManager jobDefinitionManager = commandContext.JobDefinitionManager; jobDefinitionManager.delete(SeedJobDefinition); jobDefinitionManager.delete(MonitorJobDefinition); jobDefinitionManager.delete(BatchJobDefinition); commandContext.BatchManager.delete(this); configuration.deleteByteArrayValue(); fireHistoricEndEvent(); if (cascadeToHistory) { HistoricIncidentManager historicIncidentManager = commandContext.HistoricIncidentManager; historicIncidentManager.deleteHistoricIncidentsByJobDefinitionId(seedJobDefinitionId); historicIncidentManager.deleteHistoricIncidentsByJobDefinitionId(monitorJobDefinitionId); historicIncidentManager.deleteHistoricIncidentsByJobDefinitionId(batchJobDefinitionId); HistoricJobLogManager historicJobLogManager = commandContext.HistoricJobLogManager; historicJobLogManager.deleteHistoricJobLogsByJobDefinitionId(seedJobDefinitionId); historicJobLogManager.deleteHistoricJobLogsByJobDefinitionId(monitorJobDefinitionId); historicJobLogManager.deleteHistoricJobLogsByJobDefinitionId(batchJobDefinitionId); commandContext.HistoricBatchManager.deleteHistoricBatchById(id); } }
public Void execute(CommandContext commandContext) { ((JobEntity)job).delete(); HistoricIncidentManager historicIncidentManager = commandContext.HistoricIncidentManager; foreach (HistoricIncident incident in incidents) { HistoricIncidentEntity incidentEntity = (HistoricIncidentEntity)incident; historicIncidentManager.delete(incidentEntity); } commandContext.HistoricJobLogManager.deleteHistoricJobLogByJobId(job.Id); return(null); }
public virtual void delete() { HistoricIncidentManager historicIncidentManager = Context.CommandContext.HistoricIncidentManager; historicIncidentManager.deleteHistoricIncidentsByJobDefinitionId(seedJobDefinitionId); historicIncidentManager.deleteHistoricIncidentsByJobDefinitionId(monitorJobDefinitionId); historicIncidentManager.deleteHistoricIncidentsByJobDefinitionId(batchJobDefinitionId); HistoricJobLogManager historicJobLogManager = Context.CommandContext.HistoricJobLogManager; historicJobLogManager.deleteHistoricJobLogsByJobDefinitionId(seedJobDefinitionId); historicJobLogManager.deleteHistoricJobLogsByJobDefinitionId(monitorJobDefinitionId); historicJobLogManager.deleteHistoricJobLogsByJobDefinitionId(batchJobDefinitionId); Context.CommandContext.HistoricBatchManager.delete(this); }