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
-
Constructor Summary
-
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) int
calculateInvocationsPerBatchJob
(String batchType, SetRemovalTimeBatchConfiguration configuration) Determine the number of invocations ber patch job.protected Date
calculateRemovalTime
(HistoricProcessInstanceEntity processInstance, CommandContext commandContext) protected SetRemovalTimeBatchConfiguration
createJobConfiguration
(SetRemovalTimeBatchConfiguration configuration, List<String> processInstanceIds) protected TransactionListener
createTransactionHandler
(SetRemovalTimeBatchConfiguration configuration, Map<Class<? extends DbEntity>, DbOperation> operations, Integer chunkSize, MessageEntity currentJob, CommandExecutor newCommandExecutor) void
executeHandler
(SetRemovalTimeBatchConfiguration configuration, ExecutionEntity execution, CommandContext commandContext, String tenantId) protected ByteArrayEntity
findByteArrayById
(String byteArrayId, CommandContext commandContext) protected ProcessDefinition
findProcessDefinitionById
(String processDefinitionId, CommandContext commandContext) protected HistoricProcessInstanceEntity
findProcessInstanceById
(String instanceId, CommandContext commandContext) protected String
getHistoryRemovalTimeStrategy
(CommandContext commandContext) Get the job declaration for batch jobs.protected SetRemovalTimeJsonConverter
protected Date
getOrCalculateRemovalTime
(SetRemovalTimeBatchConfiguration configuration, HistoricProcessInstanceEntity instance, CommandContext commandContext) getType()
protected int
getUpdateChunkSize
(SetRemovalTimeBatchConfiguration configuration, CommandContext commandContext) protected boolean
hasBaseTime
(HistoricProcessInstanceEntity instance, CommandContext commandContext) protected boolean
hasHierarchy
(HistoricProcessInstanceEntity instance) protected boolean
isDmnEnabled
(CommandContext commandContext) protected boolean
isEnded
(HistoricProcessInstanceEntity instance) protected boolean
isStrategyEnd
(CommandContext commandContext) protected boolean
isStrategyStart
(CommandContext commandContext) protected void
registerTransactionHandler
(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:
executeHandler
in 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:BatchJobHandler
Get the job declaration for batch jobs.- Specified by:
getJobDeclaration
in interfaceBatchJobHandler<SetRemovalTimeBatchConfiguration>
- Specified by:
getJobDeclaration
in classAbstractBatchJobHandler<SetRemovalTimeBatchConfiguration>
- Returns:
- the batch job declaration
-
createJobConfiguration
protected SetRemovalTimeBatchConfiguration createJobConfiguration(SetRemovalTimeBatchConfiguration configuration, List<String> processInstanceIds) - Specified by:
createJobConfiguration
in classAbstractBatchJobHandler<SetRemovalTimeBatchConfiguration>
-
getJsonConverterInstance
- Specified by:
getJsonConverterInstance
in classAbstractBatchJobHandler<SetRemovalTimeBatchConfiguration>
-
calculateInvocationsPerBatchJob
public int calculateInvocationsPerBatchJob(String batchType, SetRemovalTimeBatchConfiguration configuration) Description copied from interface:BatchJobHandler
Determine 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:
calculateInvocationsPerBatchJob
in interfaceBatchJobHandler<SetRemovalTimeBatchConfiguration>
- Overrides:
calculateInvocationsPerBatchJob
in 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
-