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 BatchMonitorJobDeclarationBATCH_MONITOR_JOB_DECLARATIONstatic BatchSeedJobDeclarationBATCH_SEED_JOB_DECLARATIONprotected JobDefinitionEntitybatchJobDefinitionprotected java.lang.StringbatchJobDefinitionIdprotected BatchJobHandler<?>batchJobHandlerprotected intbatchJobsPerSeedprotected ByteArrayFieldconfigurationprotected java.lang.StringcreateUserIdprotected java.lang.Stringidprotected intinvocationsPerBatchJobprotected intjobsCreatedprotected JobDefinitionEntitymonitorJobDefinitionprotected java.lang.StringmonitorJobDefinitionIdprotected intrevisionprotected JobDefinitionEntityseedJobDefinitionprotected java.lang.StringseedJobDefinitionIdprotected intsuspensionStateprotected java.lang.StringtenantIdprotected inttotalJobsprotected java.lang.Stringtype-
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.DatecalculateMonitorJobDueDate()JobDefinitionEntitycreateBatchJobDefinition()JobEntitycreateMonitorJob(boolean setDueDate)JobDefinitionEntitycreateMonitorJobDefinition()JobEntitycreateSeedJob()JobDefinitionEntitycreateSeedJobDefinition(java.lang.String deploymentId)voiddelete(boolean cascadeToHistory, boolean deleteJobs)voiddeleteMonitorJob()voiddeleteSeedJob()protected voiddeleteVariables(CommandContext commandContext)voidfireHistoricEndEvent()voidfireHistoricStartEvent()JobDefinitionEntitygetBatchJobDefinition()java.lang.StringgetBatchJobDefinitionId()BatchJobHandler<?>getBatchJobHandler()intgetBatchJobsPerSeed()java.lang.StringgetConfiguration()byte[]getConfigurationBytes()java.lang.StringgetCreateUserId()java.lang.StringgetId()intgetInvocationsPerBatchJob()intgetJobsCreated()JobDefinitionEntitygetMonitorJobDefinition()java.lang.StringgetMonitorJobDefinitionId()java.lang.StringgetName()java.lang.ObjectgetPersistentState()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 referencesintgetRevision()intgetRevisionNext()JobDefinitionEntitygetSeedJobDefinition()java.lang.StringgetSeedJobDefinitionId()intgetSuspensionState()java.lang.StringgetTenantId()intgetTotalJobs()java.lang.StringgetType()booleanisCompleted()booleanisSuspended()Indicates whether this batch is suspended.voidsetBatchJobDefinitionId(java.lang.String batchJobDefinitionId)voidsetBatchJobsPerSeed(int batchJobsPerSeed)voidsetConfiguration(java.lang.String configuration)voidsetConfigurationBytes(byte[] configuration)voidsetCreateUserId(java.lang.String createUserId)voidsetId(java.lang.String id)voidsetInvocationsPerBatchJob(int invocationsPerBatchJob)voidsetJobsCreated(int jobsCreated)voidsetMonitorJobDefinitionId(java.lang.String monitorJobDefinitionId)voidsetRevision(int revision)voidsetSeedJobDefinitionId(java.lang.String seedJobDefinitionId)voidsetSuspensionState(int state)voidsetTenantId(java.lang.String tenantId)voidsetTotalJobs(int totalJobs)voidsetType(java.lang.String type)java.lang.StringtoString()-
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
-
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:
getTotalJobsin 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:
getJobsCreatedin 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:
getBatchJobsPerSeedin interfaceBatch- Returns:
- number of batch jobs created per batch seed job invocation
-
setBatchJobsPerSeed
public void setBatchJobsPerSeed(int batchJobsPerSeed)
-
getInvocationsPerBatchJob
public int getInvocationsPerBatchJob()
- Specified by:
getInvocationsPerBatchJobin interfaceBatch- Returns:
- the number of invocations executed per batch job
-
setInvocationsPerBatchJob
public void setInvocationsPerBatchJob(int invocationsPerBatchJob)
-
getSeedJobDefinitionId
public java.lang.String getSeedJobDefinitionId()
- Specified by:
getSeedJobDefinitionIdin 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:
getMonitorJobDefinitionIdin 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:
getBatchJobDefinitionIdin 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:
getTenantIdin 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:
getCreateUserIdin 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:BatchIndicates 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:
isSuspendedin interfaceBatch- Returns:
- true if this batch is currently suspended, false otherwise
- See Also:
ManagementService.suspendBatchById(String),ManagementService.activateBatchById(String)
-
setRevision
public void setRevision(int revision)
- Specified by:
setRevisionin interfaceHasDbRevision
-
getRevision
public int getRevision()
- Specified by:
getRevisionin interfaceHasDbRevision
-
getRevisionNext
public int getRevisionNext()
- Specified by:
getRevisionNextin 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:DbEntityReturns 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:
getPersistentStatein 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()
-
isCompleted
public boolean isCompleted()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getReferencedEntityIds
public java.util.Set<java.lang.String> getReferencedEntityIds()
Description copied from interface:HasDbReferencesScope: IN-MEMORY references
- Specified by:
getReferencedEntityIdsin 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:HasDbReferencesScope: IN-MEMORY references
- Specified by:
getReferencedEntitiesIdAndClassin 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.
-
-