Beispiel #1
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);
            }
        }
Beispiel #2
0
        public virtual void execute(BatchSeedJobConfiguration configuration, ExecutionEntity execution, CommandContext commandContext, string tenantId)
        {
            string      batchId = configuration.BatchId;
            BatchEntity batch   = commandContext.BatchManager.findBatchById(batchId);

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

//JAVA TO C# CONVERTER WARNING: Java wildcard generics have no direct equivalent in .NET:
//ORIGINAL LINE: BatchJobHandler<?> batchJobHandler = commandContext.getProcessEngineConfiguration().getBatchHandlers().get(batch.getType());
            BatchJobHandler <object> batchJobHandler = commandContext.ProcessEngineConfiguration.BatchHandlers[batch.Type];

            bool done = batchJobHandler.createJobs(batch);

            if (!done)
            {
                batch.createSeedJob();
            }
            else
            {
                // create monitor job initially without due date to
                // enable rapid completion of simple batches
                batch.createMonitorJob(false);
            }
        }