예제 #1
0
        public virtual void execute(HistoryCleanupJobHandlerConfiguration configuration, ExecutionEntity execution, CommandContext commandContext, string tenantId)
        {
            HistoryCleanupHandler cleanupHandler = initCleanupHandler(configuration, commandContext);

            if (configuration.ImmediatelyDue || isWithinBatchWindow(commandContext))
            {
                cleanupHandler.performCleanup();
            }

            commandContext.TransactionContext.addTransactionListener(TransactionState.COMMITTED, cleanupHandler);
        }
예제 #2
0
        protected internal virtual HistoryCleanupHandler initCleanupHandler(HistoryCleanupJobHandlerConfiguration configuration, CommandContext commandContext)
        {
            HistoryCleanupHandler cleanupHandler = null;

            if (isHistoryCleanupStrategyRemovalTimeBased(commandContext))
            {
                cleanupHandler = new HistoryCleanupRemovalTime();
            }
            else
            {
                cleanupHandler = new HistoryCleanupBatch();
            }

            CommandExecutor commandExecutor = commandContext.ProcessEngineConfiguration.CommandExecutorTxRequiresNew;

            string jobId = commandContext.CurrentJob.Id;

            return(cleanupHandler.setConfiguration(configuration).setCommandExecutor(commandExecutor).setJobId(jobId));
        }
예제 #3
0
 public CommandAnonymousInnerClass(HistoryCleanupHandler outerInstance, CommandContext commandContext)
 {
     this.outerInstance  = outerInstance;
     this.commandContext = commandContext;
 }