Class BatchEntity
- java.lang.Object
-
- org.camunda.bpm.engine.impl.batch.BatchEntity
-
- All Implemented Interfaces:
Batch
,DbEntity
,HasDbReferences
,HasDbRevision
,Nameable
- Direct Known Subclasses:
BatchStatisticsEntity
public class BatchEntity extends java.lang.Object implements Batch, DbEntity, HasDbReferences, Nameable, HasDbRevision
-
-
Field Summary
Fields Modifier and Type Field Description static BatchMonitorJobDeclaration
BATCH_MONITOR_JOB_DECLARATION
static BatchSeedJobDeclaration
BATCH_SEED_JOB_DECLARATION
protected JobDefinitionEntity
batchJobDefinition
protected java.lang.String
batchJobDefinitionId
protected BatchJobHandler<?>
batchJobHandler
protected int
batchJobsPerSeed
protected ByteArrayField
configuration
protected java.lang.String
createUserId
protected java.util.Date
executionStartTime
protected java.lang.String
id
protected int
invocationsPerBatchJob
protected int
jobsCreated
protected JobDefinitionEntity
monitorJobDefinition
protected java.lang.String
monitorJobDefinitionId
protected int
revision
protected JobDefinitionEntity
seedJobDefinition
protected java.lang.String
seedJobDefinitionId
protected java.util.Date
startTime
protected int
suspensionState
protected java.lang.String
tenantId
protected int
totalJobs
protected java.lang.String
type
-
Fields inherited from interface org.camunda.bpm.engine.batch.Batch
TYPE_BATCH_SET_REMOVAL_TIME, TYPE_CORRELATE_MESSAGE, TYPE_DECISION_SET_REMOVAL_TIME, TYPE_HISTORIC_DECISION_INSTANCE_DELETION, TYPE_HISTORIC_PROCESS_INSTANCE_DELETION, TYPE_PROCESS_INSTANCE_DELETION, TYPE_PROCESS_INSTANCE_MIGRATION, TYPE_PROCESS_INSTANCE_MODIFICATION, TYPE_PROCESS_INSTANCE_RESTART, TYPE_PROCESS_INSTANCE_UPDATE_SUSPENSION_STATE, TYPE_PROCESS_SET_REMOVAL_TIME, TYPE_SET_EXTERNAL_TASK_RETRIES, TYPE_SET_JOB_RETRIES, TYPE_SET_VARIABLES
-
-
Constructor Summary
Constructors Constructor Description BatchEntity()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.util.Date
calculateMonitorJobDueDate()
JobDefinitionEntity
createBatchJobDefinition()
JobEntity
createMonitorJob(boolean setDueDate)
JobDefinitionEntity
createMonitorJobDefinition()
JobEntity
createSeedJob()
JobDefinitionEntity
createSeedJobDefinition(java.lang.String deploymentId)
void
delete(boolean cascadeToHistory, boolean deleteJobs)
void
deleteMonitorJob()
void
deleteSeedJob()
protected void
deleteVariables(CommandContext commandContext)
void
fireHistoricEndEvent()
void
fireHistoricStartEvent()
void
fireHistoricUpdateEvent()
JobDefinitionEntity
getBatchJobDefinition()
java.lang.String
getBatchJobDefinitionId()
BatchJobHandler<?>
getBatchJobHandler()
int
getBatchJobsPerSeed()
java.lang.String
getConfiguration()
byte[]
getConfigurationBytes()
java.lang.String
getCreateUserId()
java.util.Date
getExecutionStartTime()
java.lang.String
getId()
int
getInvocationsPerBatchJob()
int
getJobsCreated()
JobDefinitionEntity
getMonitorJobDefinition()
java.lang.String
getMonitorJobDefinitionId()
java.lang.String
getName()
java.lang.Object
getPersistentState()
Returns a representation of the object, as would be stored in the database.java.util.Map<java.lang.String,java.lang.Class>
getReferencedEntitiesIdAndClass()
Scope: IN-MEMORY referencesjava.util.Set<java.lang.String>
getReferencedEntityIds()
Scope: IN-MEMORY referencesint
getRevision()
int
getRevisionNext()
JobDefinitionEntity
getSeedJobDefinition()
java.lang.String
getSeedJobDefinitionId()
java.util.Date
getStartTime()
int
getSuspensionState()
java.lang.String
getTenantId()
int
getTotalJobs()
java.lang.String
getType()
boolean
isCompleted()
boolean
isSuspended()
Indicates whether this batch is suspended.void
setBatchJobDefinitionId(java.lang.String batchJobDefinitionId)
void
setBatchJobsPerSeed(int batchJobsPerSeed)
void
setConfiguration(java.lang.String configuration)
void
setConfigurationBytes(byte[] configuration)
void
setCreateUserId(java.lang.String createUserId)
void
setExecutionStartTime(java.util.Date executionStartTime)
void
setId(java.lang.String id)
void
setInvocationsPerBatchJob(int invocationsPerBatchJob)
void
setJobsCreated(int jobsCreated)
void
setMonitorJobDefinitionId(java.lang.String monitorJobDefinitionId)
void
setRevision(int revision)
void
setSeedJobDefinitionId(java.lang.String seedJobDefinitionId)
void
setStartTime(java.util.Date startTime)
void
setSuspensionState(int state)
void
setTenantId(java.lang.String tenantId)
void
setTotalJobs(int totalJobs)
void
setType(java.lang.String type)
java.lang.String
toString()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.camunda.bpm.engine.impl.db.HasDbReferences
getDependentEntities
-
-
-
-
Field Detail
-
BATCH_SEED_JOB_DECLARATION
public static final BatchSeedJobDeclaration BATCH_SEED_JOB_DECLARATION
-
BATCH_MONITOR_JOB_DECLARATION
public static final BatchMonitorJobDeclaration BATCH_MONITOR_JOB_DECLARATION
-
id
protected java.lang.String id
-
type
protected java.lang.String type
-
totalJobs
protected int totalJobs
-
jobsCreated
protected int jobsCreated
-
batchJobsPerSeed
protected int batchJobsPerSeed
-
invocationsPerBatchJob
protected int invocationsPerBatchJob
-
seedJobDefinitionId
protected java.lang.String seedJobDefinitionId
-
monitorJobDefinitionId
protected java.lang.String monitorJobDefinitionId
-
batchJobDefinitionId
protected java.lang.String batchJobDefinitionId
-
configuration
protected ByteArrayField configuration
-
tenantId
protected java.lang.String tenantId
-
createUserId
protected java.lang.String createUserId
-
suspensionState
protected int suspensionState
-
startTime
protected java.util.Date startTime
-
executionStartTime
protected java.util.Date executionStartTime
-
revision
protected int revision
-
seedJobDefinition
protected JobDefinitionEntity seedJobDefinition
-
monitorJobDefinition
protected JobDefinitionEntity monitorJobDefinition
-
batchJobDefinition
protected JobDefinitionEntity batchJobDefinition
-
batchJobHandler
protected BatchJobHandler<?> batchJobHandler
-
-
Method Detail
-
getId
public java.lang.String getId()
-
getType
public java.lang.String getType()
-
setType
public void setType(java.lang.String type)
-
getTotalJobs
public int getTotalJobs()
- Specified by:
getTotalJobs
in interfaceBatch
- Returns:
- the number of batch execution jobs required to complete the batch
-
setTotalJobs
public void setTotalJobs(int totalJobs)
-
getJobsCreated
public int getJobsCreated()
- Specified by:
getJobsCreated
in interfaceBatch
- Returns:
- the number of batch execution jobs already created by the seed job
-
setJobsCreated
public void setJobsCreated(int jobsCreated)
-
getBatchJobsPerSeed
public int getBatchJobsPerSeed()
- Specified by:
getBatchJobsPerSeed
in interfaceBatch
- Returns:
- number of batch jobs created per batch seed job invocation
-
setBatchJobsPerSeed
public void setBatchJobsPerSeed(int batchJobsPerSeed)
-
getInvocationsPerBatchJob
public int getInvocationsPerBatchJob()
- Specified by:
getInvocationsPerBatchJob
in interfaceBatch
- Returns:
- the number of invocations executed per batch job
-
setInvocationsPerBatchJob
public void setInvocationsPerBatchJob(int invocationsPerBatchJob)
-
getSeedJobDefinitionId
public java.lang.String getSeedJobDefinitionId()
- Specified by:
getSeedJobDefinitionId
in interfaceBatch
- Returns:
- the id of the batch seed job definition
-
setSeedJobDefinitionId
public void setSeedJobDefinitionId(java.lang.String seedJobDefinitionId)
-
getMonitorJobDefinitionId
public java.lang.String getMonitorJobDefinitionId()
- Specified by:
getMonitorJobDefinitionId
in interfaceBatch
- Returns:
- the id of the batch monitor job definition
-
setMonitorJobDefinitionId
public void setMonitorJobDefinitionId(java.lang.String monitorJobDefinitionId)
-
getBatchJobDefinitionId
public java.lang.String getBatchJobDefinitionId()
- Specified by:
getBatchJobDefinitionId
in interfaceBatch
- Returns:
- the id of the batch job definition
-
setBatchJobDefinitionId
public void setBatchJobDefinitionId(java.lang.String batchJobDefinitionId)
-
getTenantId
public java.lang.String getTenantId()
- Specified by:
getTenantId
in interfaceBatch
- Returns:
- the batch's tenant id or null
-
setTenantId
public void setTenantId(java.lang.String tenantId)
-
getCreateUserId
public java.lang.String getCreateUserId()
- Specified by:
getCreateUserId
in interfaceBatch
- Returns:
- the batch creator's user id
-
setCreateUserId
public void setCreateUserId(java.lang.String createUserId)
-
getConfiguration
public java.lang.String getConfiguration()
-
setConfiguration
public void setConfiguration(java.lang.String configuration)
-
setSuspensionState
public void setSuspensionState(int state)
-
getSuspensionState
public int getSuspensionState()
-
isSuspended
public boolean isSuspended()
Description copied from interface:Batch
Indicates whether this batch is suspended. If a batch is suspended, the batch jobs will not be acquired by the job executor.
Note: It is still possible to manually suspend and activate jobs and job definitions using the
ManagementService
, which will not change the suspension state of the batch.- Specified by:
isSuspended
in interfaceBatch
- Returns:
- true if this batch is currently suspended, false otherwise
- See Also:
ManagementService.suspendBatchById(String)
,ManagementService.activateBatchById(String)
-
getStartTime
public java.util.Date getStartTime()
- Specified by:
getStartTime
in interfaceBatch
- Returns:
- the date the batch was started
-
setStartTime
public void setStartTime(java.util.Date startTime)
-
getExecutionStartTime
public java.util.Date getExecutionStartTime()
- Specified by:
getExecutionStartTime
in interfaceBatch
- Returns:
- the date the batch execution started
-
setExecutionStartTime
public void setExecutionStartTime(java.util.Date executionStartTime)
-
setRevision
public void setRevision(int revision)
- Specified by:
setRevision
in interfaceHasDbRevision
-
getRevision
public int getRevision()
- Specified by:
getRevision
in interfaceHasDbRevision
-
getRevisionNext
public int getRevisionNext()
- Specified by:
getRevisionNext
in interfaceHasDbRevision
-
getSeedJobDefinition
public JobDefinitionEntity getSeedJobDefinition()
-
getMonitorJobDefinition
public JobDefinitionEntity getMonitorJobDefinition()
-
getBatchJobDefinition
public JobDefinitionEntity getBatchJobDefinition()
-
getConfigurationBytes
public byte[] getConfigurationBytes()
-
setConfigurationBytes
public void setConfigurationBytes(byte[] configuration)
-
getBatchJobHandler
public BatchJobHandler<?> getBatchJobHandler()
-
getPersistentState
public java.lang.Object getPersistentState()
Description copied from interface:DbEntity
Returns a representation of the object, as would be stored in the database. Used when deciding if updates have occurred to the object or not since it was last loaded.- Specified by:
getPersistentState
in interfaceDbEntity
-
createSeedJobDefinition
public JobDefinitionEntity createSeedJobDefinition(java.lang.String deploymentId)
-
createMonitorJobDefinition
public JobDefinitionEntity createMonitorJobDefinition()
-
createBatchJobDefinition
public JobDefinitionEntity createBatchJobDefinition()
-
createSeedJob
public JobEntity createSeedJob()
-
deleteSeedJob
public void deleteSeedJob()
-
createMonitorJob
public JobEntity createMonitorJob(boolean setDueDate)
-
calculateMonitorJobDueDate
protected java.util.Date calculateMonitorJobDueDate()
-
deleteMonitorJob
public void deleteMonitorJob()
-
delete
public void delete(boolean cascadeToHistory, boolean deleteJobs)
-
deleteVariables
protected void deleteVariables(CommandContext commandContext)
-
fireHistoricStartEvent
public void fireHistoricStartEvent()
-
fireHistoricEndEvent
public void fireHistoricEndEvent()
-
fireHistoricUpdateEvent
public void fireHistoricUpdateEvent()
-
isCompleted
public boolean isCompleted()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
getReferencedEntityIds
public java.util.Set<java.lang.String> getReferencedEntityIds()
Description copied from interface:HasDbReferences
Scope: IN-MEMORY references
- Specified by:
getReferencedEntityIds
in interfaceHasDbReferences
- Returns:
- the ids of the entities that this entity references. Should only return ids for entities of the same type
-
getReferencedEntitiesIdAndClass
public java.util.Map<java.lang.String,java.lang.Class> getReferencedEntitiesIdAndClass()
Description copied from interface:HasDbReferences
Scope: IN-MEMORY references
- Specified by:
getReferencedEntitiesIdAndClass
in interfaceHasDbReferences
- Returns:
- a map of the ids and the entities' classes that this entity references. It's used when trying to determine if there was an Optimistic Locking occurrence on an INSERT or UPDATE of an object of this type.
-
-