Class ProcessSetRemovalTimeJobHandler
java.lang.Object
org.camunda.bpm.engine.impl.batch.AbstractBatchJobHandler<SetRemovalTimeBatchConfiguration>
org.camunda.bpm.engine.impl.batch.removaltime.ProcessSetRemovalTimeJobHandler
- All Implemented Interfaces:
BatchJobHandler<SetRemovalTimeBatchConfiguration>,OptimisticLockingListener,JobHandler<BatchJobConfiguration>
public class ProcessSetRemovalTimeJobHandler
extends AbstractBatchJobHandler<SetRemovalTimeBatchConfiguration>
- Author:
- Tassilo Weidner
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Map<Class<? extends DbEntity>,DbOperation> addRemovalTime(String instanceId, Date removalTime, Integer batchSize, Set<String> entities, CommandContext commandContext) protected Map<Class<? extends DbEntity>,DbOperation> addRemovalTimeToHierarchy(String rootProcessInstanceId, Date removalTime, Integer batchSize, Set<String> entities, CommandContext commandContext) protected Map<Class<? extends DbEntity>,DbOperation> addRemovalTimeToInstance(String instanceId, SetRemovalTimeBatchConfiguration configuration, Integer batchSize, Set<String> entities, CommandContext commandContext) intcalculateInvocationsPerBatchJob(String batchType, SetRemovalTimeBatchConfiguration configuration) Determine the number of invocations ber patch job.protected DatecalculateRemovalTime(HistoricProcessInstanceEntity processInstance, CommandContext commandContext) protected SetRemovalTimeBatchConfigurationcreateJobConfiguration(SetRemovalTimeBatchConfiguration configuration, List<String> processInstanceIds) protected TransactionListenercreateTransactionHandler(SetRemovalTimeBatchConfiguration configuration, Map<Class<? extends DbEntity>, DbOperation> operations, Integer chunkSize, MessageEntity currentJob, CommandExecutor newCommandExecutor) voidexecuteHandler(SetRemovalTimeBatchConfiguration configuration, ExecutionEntity execution, CommandContext commandContext, String tenantId) protected ByteArrayEntityfindByteArrayById(String byteArrayId, CommandContext commandContext) protected ProcessDefinitionfindProcessDefinitionById(String processDefinitionId, CommandContext commandContext) protected HistoricProcessInstanceEntityfindProcessInstanceById(String instanceId, CommandContext commandContext) protected StringgetHistoryRemovalTimeStrategy(CommandContext commandContext) Get the job declaration for batch jobs.protected SetRemovalTimeJsonConverterprotected DategetOrCalculateRemovalTime(SetRemovalTimeBatchConfiguration configuration, HistoricProcessInstanceEntity instance, CommandContext commandContext) getType()protected intgetUpdateChunkSize(SetRemovalTimeBatchConfiguration configuration, CommandContext commandContext) protected booleanhasBaseTime(HistoricProcessInstanceEntity instance, CommandContext commandContext) protected booleanhasHierarchy(HistoricProcessInstanceEntity instance) protected booleanisDmnEnabled(CommandContext commandContext) protected booleanisEnded(HistoricProcessInstanceEntity instance) protected booleanisStrategyEnd(CommandContext commandContext) protected booleanisStrategyStart(CommandContext commandContext) protected voidregisterTransactionHandler(SetRemovalTimeBatchConfiguration configuration, Map<Class<? extends DbEntity>, DbOperation> operations, Integer chunkSize, MessageEntity currentJob, CommandContext commandContext) Methods inherited from class org.camunda.bpm.engine.impl.batch.AbstractBatchJobHandler
createBatchJob, createJobEntities, createJobs, deleteJobs, execute, failedOperation, getEntityType, newConfiguration, onDelete, postProcessJob, readConfiguration, sanitizeMappings, saveConfiguration, writeConfiguration
-
Field Details
-
JOB_DECLARATION
-
MAX_CHUNK_SIZE
public static final int MAX_CHUNK_SIZE- See Also:
-
-
Constructor Details
-
ProcessSetRemovalTimeJobHandler
public ProcessSetRemovalTimeJobHandler()
-
-
Method Details
-
executeHandler
public void executeHandler(SetRemovalTimeBatchConfiguration configuration, ExecutionEntity execution, CommandContext commandContext, String tenantId) - Specified by:
executeHandlerin classAbstractBatchJobHandler<SetRemovalTimeBatchConfiguration>
-
addRemovalTimeToInstance
protected Map<Class<? extends DbEntity>,DbOperation> addRemovalTimeToInstance(String instanceId, SetRemovalTimeBatchConfiguration configuration, Integer batchSize, Set<String> entities, CommandContext commandContext) -
getOrCalculateRemovalTime
protected Date getOrCalculateRemovalTime(SetRemovalTimeBatchConfiguration configuration, HistoricProcessInstanceEntity instance, CommandContext commandContext) -
addRemovalTimeToHierarchy
protected Map<Class<? extends DbEntity>,DbOperation> addRemovalTimeToHierarchy(String rootProcessInstanceId, Date removalTime, Integer batchSize, Set<String> entities, CommandContext commandContext) -
addRemovalTime
protected Map<Class<? extends DbEntity>,DbOperation> addRemovalTime(String instanceId, Date removalTime, Integer batchSize, Set<String> entities, CommandContext commandContext) -
hasBaseTime
protected boolean hasBaseTime(HistoricProcessInstanceEntity instance, CommandContext commandContext) -
isEnded
-
isStrategyStart
-
isStrategyEnd
-
hasHierarchy
-
getHistoryRemovalTimeStrategy
-
findProcessDefinitionById
protected ProcessDefinition findProcessDefinitionById(String processDefinitionId, CommandContext commandContext) -
isDmnEnabled
-
calculateRemovalTime
protected Date calculateRemovalTime(HistoricProcessInstanceEntity processInstance, CommandContext commandContext) -
findByteArrayById
-
findProcessInstanceById
protected HistoricProcessInstanceEntity findProcessInstanceById(String instanceId, CommandContext commandContext) -
registerTransactionHandler
protected void registerTransactionHandler(SetRemovalTimeBatchConfiguration configuration, Map<Class<? extends DbEntity>, DbOperation> operations, Integer chunkSize, MessageEntity currentJob, CommandContext commandContext) -
getUpdateChunkSize
protected int getUpdateChunkSize(SetRemovalTimeBatchConfiguration configuration, CommandContext commandContext) -
createTransactionHandler
protected TransactionListener createTransactionHandler(SetRemovalTimeBatchConfiguration configuration, Map<Class<? extends DbEntity>, DbOperation> operations, Integer chunkSize, MessageEntity currentJob, CommandExecutor newCommandExecutor) -
getJobDeclaration
Description copied from interface:BatchJobHandlerGet the job declaration for batch jobs.- Specified by:
getJobDeclarationin interfaceBatchJobHandler<SetRemovalTimeBatchConfiguration>- Specified by:
getJobDeclarationin classAbstractBatchJobHandler<SetRemovalTimeBatchConfiguration>- Returns:
- the batch job declaration
-
createJobConfiguration
protected SetRemovalTimeBatchConfiguration createJobConfiguration(SetRemovalTimeBatchConfiguration configuration, List<String> processInstanceIds) - Specified by:
createJobConfigurationin classAbstractBatchJobHandler<SetRemovalTimeBatchConfiguration>
-
getJsonConverterInstance
- Specified by:
getJsonConverterInstancein classAbstractBatchJobHandler<SetRemovalTimeBatchConfiguration>
-
calculateInvocationsPerBatchJob
public int calculateInvocationsPerBatchJob(String batchType, SetRemovalTimeBatchConfiguration configuration) Description copied from interface:BatchJobHandlerDetermine the number of invocations ber patch job. This can be defined by the related batch job handler specifically or otherwise taken from the engine configuration.- Specified by:
calculateInvocationsPerBatchJobin interfaceBatchJobHandler<SetRemovalTimeBatchConfiguration>- Overrides:
calculateInvocationsPerBatchJobin classAbstractBatchJobHandler<SetRemovalTimeBatchConfiguration>- Parameters:
batchType- the batch's type to help determine any engine configuration related to itconfiguration- the configuration object- Returns:
- the number of invocations ber patch job
-
getType
-