コード例 #1
0
        public virtual Void execute(CommandContext commandContext)
        {
            ensureNotNull(typeof(BadUserRequestException), "Batch id must not be null", "batch id", batchId);

            BatchEntity batchEntity = commandContext.BatchManager.findBatchById(batchId);

            ensureNotNull(typeof(BadUserRequestException), "Batch for id '" + batchId + "' cannot be found", "batch", batchEntity);

            checkAccess(commandContext, batchEntity);
            writeUserOperationLog(commandContext);
            batchEntity.delete(cascadeToHistory);

            return(null);
        }
コード例 #2
0
        public virtual void execute(BatchMonitorJobConfiguration configuration, ExecutionEntity execution, CommandContext commandContext, string tenantId)
        {
            string      batchId = configuration.BatchId;
            BatchEntity batch   = commandContext.BatchManager.findBatchById(configuration.BatchId);

            ensureNotNull("Batch with id '" + batchId + "' cannot be found", "batch", batch);

            bool completed = batch.Completed;

            if (!completed)
            {
                batch.createMonitorJob(true);
            }
            else
            {
                batch.delete(false);
            }
        }