Exemplo n.º 1
0
        public virtual object Execute(CommandContext commandContext)
        {
            EnsureUtil.EnsureNotNull(typeof(BadUserRequestException), "Batch id must not be null", "batch id", batchId);

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

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

            CheckAccess(commandContext, batchEntity);

            batchEntity.Delete(cascadeToHistory);
            return(null);
        }
Exemplo n.º 2
0
        public virtual void Execute(IJobHandlerConfiguration configuration, ExecutionEntity execution,
                                    CommandContext commandContext, string tenantId)
        {
            var         conf    = (BatchMonitorJobConfiguration)configuration;
            var         batchId = conf.BatchId;
            BatchEntity batch   = commandContext.BatchManager.FindBatchById(conf.BatchId);

            EnsureUtil.EnsureNotNull("Batch with id '" + batchId + "' cannot be found", "batch", batch);

            bool completed = batch.Completed;

            if (!completed)
            {
                //batch.CreateMonitorJob(true);
            }
            else
            {
                batch.Delete(false);
            }
        }