Beispiel #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);
        }
Beispiel #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));
        }
Beispiel #3
0
 public CommandAnonymousInnerClass(HistoryCleanupHandler outerInstance, CommandContext commandContext)
 {
     this.outerInstance  = outerInstance;
     this.commandContext = commandContext;
 }