public virtual object Execute(CommandContext commandContext) { EnsureUtil.EnsureNotNull(typeof(BadUserRequestException), "Batch id must not be null", "batch id", BatchId); BatchManager batchManager = commandContext.BatchManager as BatchManager; BatchEntity batch = batchManager.FindBatchById(BatchId); EnsureUtil.EnsureNotNull(typeof(BadUserRequestException), "Batch for id '" + BatchId + "' cannot be found", "batch", batch); CheckAccess(commandContext, batch); SetJobDefinitionState(commandContext, batch.SeedJobDefinitionId); SetJobDefinitionState(commandContext, batch.MonitorJobDefinitionId); SetJobDefinitionState(commandContext, batch.BatchJobDefinitionId); batchManager.UpdateBatchSuspensionStateById(BatchId, NewSuspensionState); LogUserOperation(commandContext); return(null); }