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