Class ProcessDefinitionManager
- java.lang.Object
-
- org.camunda.bpm.engine.impl.persistence.AbstractManager
-
- org.camunda.bpm.engine.impl.persistence.entity.ProcessDefinitionManager
-
- All Implemented Interfaces:
Session
,AbstractResourceDefinitionManager<ProcessDefinitionEntity>
public class ProcessDefinitionManager extends AbstractManager implements AbstractResourceDefinitionManager<ProcessDefinitionEntity>
- Author:
- Tom Baeyens, Falko Menge, Saeid Mirzaei, Christopher Zell
-
-
Field Summary
Fields Modifier and Type Field Description protected static EnginePersistenceLogger
LOG
-
Constructor Summary
Constructors Constructor Description ProcessDefinitionManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
cascadeDeleteHistoryForProcessDefinition(java.lang.String processDefinitionId)
Cascades the deletion of a process definition to the history, deletes the history.protected void
cascadeDeleteProcessInstancesForProcessDefinition(java.lang.String processDefinitionId, boolean skipCustomListeners, boolean skipIoMappings)
Cascades the deletion of the process definition to the process instances.protected ListQueryParameterObject
configureParameterizedQuery(java.lang.Object parameter)
protected void
configureProcessDefinitionQuery(ProcessDefinitionQueryImpl query)
protected void
createDefaultAuthorizations(ProcessDefinition processDefinition)
void
deleteProcessDefinition(ProcessDefinition processDefinition, java.lang.String processDefinitionId, boolean cascadeToHistory, boolean cascadeToInstances, boolean skipCustomListeners, boolean skipIoMappings)
Deletes the given process definition from the database and cache.void
deleteSubscriptionsForProcessDefinition(java.lang.String processDefinitionId)
Deletes the subscriptions for the process definition, which is identified by the given process definition id.protected void
deleteTimerStartEventsForProcessDefinition(ProcessDefinition processDefinition)
Deletes the timer start events for the given process definition.ProcessDefinitionEntity
findDefinitionByDeploymentAndKey(java.lang.String deploymentId, java.lang.String definitionKey)
ProcessDefinitionEntity
findDefinitionByKeyVersionAndTenantId(java.lang.String definitionKey, java.lang.Integer definitionVersion, java.lang.String tenantId)
ProcessDefinitionEntity
findDefinitionByKeyVersionTagAndTenantId(java.lang.String definitionKey, java.lang.String definitionVersionTag, java.lang.String tenantId)
java.util.List<ProcessDefinition>
findDefinitionsByIds(java.util.Set<java.lang.String> processDefinitionIds)
java.util.List<ProcessDefinition>
findDefinitionsByKeyAndTenantId(java.lang.String processDefinitionKey, java.lang.String tenantId, boolean isTenantIdSet)
ProcessDefinitionEntity
findLatestDefinitionById(java.lang.String id)
ProcessDefinitionEntity
findLatestDefinitionByKey(java.lang.String key)
ProcessDefinitionEntity
findLatestDefinitionByKeyAndTenantId(java.lang.String definitionKey, java.lang.String tenantId)
ProcessDefinitionEntity
findLatestProcessDefinitionById(java.lang.String processDefinitionId)
ProcessDefinitionEntity
findLatestProcessDefinitionByKey(java.lang.String processDefinitionKey)
ProcessDefinitionEntity
findLatestProcessDefinitionByKeyAndTenantId(java.lang.String processDefinitionKey, java.lang.String tenantId)
java.util.List<ProcessDefinitionEntity>
findLatestProcessDefinitionsByKey(java.lang.String processDefinitionKey)
java.lang.String
findPreviousProcessDefinitionId(java.lang.String processDefinitionKey, java.lang.Integer version, java.lang.String tenantId)
ProcessDefinitionEntity
findProcessDefinitionByDeploymentAndKey(java.lang.String deploymentId, java.lang.String processDefinitionKey)
ProcessDefinitionEntity
findProcessDefinitionByKeyVersionAndTenantId(java.lang.String processDefinitionKey, java.lang.Integer processDefinitionVersion, java.lang.String tenantId)
protected ProcessDefinitionEntity
findProcessDefinitionByKeyVersionOrVersionTag(java.lang.String processDefinitionKey, java.lang.Integer processDefinitionVersion, java.lang.String processDefinitionVersionTag, java.lang.String tenantId)
ProcessDefinitionEntity
findProcessDefinitionByKeyVersionTagAndTenantId(java.lang.String processDefinitionKey, java.lang.String processDefinitionVersionTag, java.lang.String tenantId)
long
findProcessDefinitionCountByQueryCriteria(ProcessDefinitionQueryImpl processDefinitionQuery)
java.util.List<ProcessDefinition>
findProcessDefinitionsByDeploymentId(java.lang.String deploymentId)
java.util.List<ProcessDefinition>
findProcessDefinitionsByKey(java.lang.String processDefinitionKey)
java.util.List<ProcessDefinition>
findProcessDefinitionsByKeyIn(java.lang.String... keys)
java.util.List<ProcessDefinition>
findProcessDefinitionsByQueryCriteria(ProcessDefinitionQueryImpl processDefinitionQuery, Page page)
java.util.List<ProcessDefinition>
findProcessDefinitionsStartableByUser(java.lang.String user)
ProcessDefinitionEntity
getCachedResourceDefinitionEntity(java.lang.String definitionId)
void
insertProcessDefinition(ProcessDefinitionEntity processDefinition)
void
updateProcessDefinitionSuspensionStateById(java.lang.String processDefinitionId, SuspensionState suspensionState)
void
updateProcessDefinitionSuspensionStateByKey(java.lang.String processDefinitionKey, SuspensionState suspensionState)
void
updateProcessDefinitionSuspensionStateByKeyAndTenantId(java.lang.String processDefinitionKey, java.lang.String tenantId, SuspensionState suspensionState)
-
Methods inherited from class org.camunda.bpm.engine.impl.persistence.AbstractManager
checkAuthorization, close, configureQuery, delete, deleteAuthorizations, deleteAuthorizationsForGroup, deleteAuthorizationsForUser, deleteDefaultAuthorizations, flush, getAttachmentManager, getAuthorizationManager, getBatchManager, getByteArrayManager, getCamundaFormDefinitionManager, getCaseDefinitionManager, getCaseExecutionManager, getCaseInstanceManager, getCommandContext, getCurrentAuthentication, getDbEntityManager, getDbSqlSession, getDecisionDefinitionManager, getDecisionRequirementsDefinitionManager, getDeploymentManager, getEventSubscriptionManager, getHistoricActivityInstanceManager, getHistoricBatchManager, getHistoricCaseActivityInstanceManager, getHistoricCaseInstanceManager, getHistoricDecisionInstanceManager, getHistoricDetailManager, getHistoricExternalTaskLogManager, getHistoricIdentityLinkManager, getHistoricIncidentManager, getHistoricJobLogManager, getHistoricProcessInstanceManager, getHistoricReportManager, getHistoricTaskInstanceManager, getHistoricVariableInstanceManager, getIdentityInfoManager, getIdentityLinkManager, getJobDefinitionManager, getJobManager, getProcessDefinitionManager, getProcessInstanceManager, getResourceAuthorizationProvider, getResourceManager, getSession, getTaskManager, getTaskReportManager, getTenantManager, getUserOperationLogManager, getVariableInstanceManager, insert, isAuthorizationEnabled, saveDefaultAuthorizations
-
-
-
-
Field Detail
-
LOG
protected static final EnginePersistenceLogger LOG
-
-
Method Detail
-
insertProcessDefinition
public void insertProcessDefinition(ProcessDefinitionEntity processDefinition)
-
findLatestProcessDefinitionByKey
public ProcessDefinitionEntity findLatestProcessDefinitionByKey(java.lang.String processDefinitionKey)
- Returns:
- the latest version of the process definition with the given key (from any tenant)
- Throws:
ProcessEngineException
- if more than one tenant has a process definition with the given key- See Also:
findLatestProcessDefinitionByKeyAndTenantId(String, String)
-
findLatestProcessDefinitionsByKey
public java.util.List<ProcessDefinitionEntity> findLatestProcessDefinitionsByKey(java.lang.String processDefinitionKey)
- Returns:
- the latest versions of the process definition with the given key (from any tenant), contains multiple elements if more than one tenant has a process definition with the given key
- See Also:
findLatestProcessDefinitionByKey(String)
-
findLatestProcessDefinitionByKeyAndTenantId
public ProcessDefinitionEntity findLatestProcessDefinitionByKeyAndTenantId(java.lang.String processDefinitionKey, java.lang.String tenantId)
- Returns:
- the latest version of the process definition with the given key and tenant id
- See Also:
findLatestProcessDefinitionByKeyAndTenantId(String, String)
-
findLatestProcessDefinitionById
public ProcessDefinitionEntity findLatestProcessDefinitionById(java.lang.String processDefinitionId)
-
findProcessDefinitionsByQueryCriteria
public java.util.List<ProcessDefinition> findProcessDefinitionsByQueryCriteria(ProcessDefinitionQueryImpl processDefinitionQuery, Page page)
-
findProcessDefinitionCountByQueryCriteria
public long findProcessDefinitionCountByQueryCriteria(ProcessDefinitionQueryImpl processDefinitionQuery)
-
findProcessDefinitionByDeploymentAndKey
public ProcessDefinitionEntity findProcessDefinitionByDeploymentAndKey(java.lang.String deploymentId, java.lang.String processDefinitionKey)
-
findProcessDefinitionByKeyVersionAndTenantId
public ProcessDefinitionEntity findProcessDefinitionByKeyVersionAndTenantId(java.lang.String processDefinitionKey, java.lang.Integer processDefinitionVersion, java.lang.String tenantId)
-
findProcessDefinitionByKeyVersionTagAndTenantId
public ProcessDefinitionEntity findProcessDefinitionByKeyVersionTagAndTenantId(java.lang.String processDefinitionKey, java.lang.String processDefinitionVersionTag, java.lang.String tenantId)
-
findProcessDefinitionByKeyVersionOrVersionTag
protected ProcessDefinitionEntity findProcessDefinitionByKeyVersionOrVersionTag(java.lang.String processDefinitionKey, java.lang.Integer processDefinitionVersion, java.lang.String processDefinitionVersionTag, java.lang.String tenantId)
-
findProcessDefinitionsByKey
public java.util.List<ProcessDefinition> findProcessDefinitionsByKey(java.lang.String processDefinitionKey)
-
findProcessDefinitionsStartableByUser
public java.util.List<ProcessDefinition> findProcessDefinitionsStartableByUser(java.lang.String user)
-
findPreviousProcessDefinitionId
public java.lang.String findPreviousProcessDefinitionId(java.lang.String processDefinitionKey, java.lang.Integer version, java.lang.String tenantId)
-
findProcessDefinitionsByDeploymentId
public java.util.List<ProcessDefinition> findProcessDefinitionsByDeploymentId(java.lang.String deploymentId)
-
findProcessDefinitionsByKeyIn
public java.util.List<ProcessDefinition> findProcessDefinitionsByKeyIn(java.lang.String... keys)
-
findDefinitionsByKeyAndTenantId
public java.util.List<ProcessDefinition> findDefinitionsByKeyAndTenantId(java.lang.String processDefinitionKey, java.lang.String tenantId, boolean isTenantIdSet)
-
findDefinitionsByIds
public java.util.List<ProcessDefinition> findDefinitionsByIds(java.util.Set<java.lang.String> processDefinitionIds)
-
updateProcessDefinitionSuspensionStateById
public void updateProcessDefinitionSuspensionStateById(java.lang.String processDefinitionId, SuspensionState suspensionState)
-
updateProcessDefinitionSuspensionStateByKey
public void updateProcessDefinitionSuspensionStateByKey(java.lang.String processDefinitionKey, SuspensionState suspensionState)
-
updateProcessDefinitionSuspensionStateByKeyAndTenantId
public void updateProcessDefinitionSuspensionStateByKeyAndTenantId(java.lang.String processDefinitionKey, java.lang.String tenantId, SuspensionState suspensionState)
-
cascadeDeleteProcessInstancesForProcessDefinition
protected void cascadeDeleteProcessInstancesForProcessDefinition(java.lang.String processDefinitionId, boolean skipCustomListeners, boolean skipIoMappings)
Cascades the deletion of the process definition to the process instances. Skips the custom listeners if the flag was set to true.- Parameters:
processDefinitionId
- the process definition idskipCustomListeners
- true if the custom listeners should be skipped at process instance deletionskipIoMappings
- specifies whether input/output mappings for tasks should be invoked
-
cascadeDeleteHistoryForProcessDefinition
protected void cascadeDeleteHistoryForProcessDefinition(java.lang.String processDefinitionId)
Cascades the deletion of a process definition to the history, deletes the history.- Parameters:
processDefinitionId
- the process definition id
-
deleteTimerStartEventsForProcessDefinition
protected void deleteTimerStartEventsForProcessDefinition(ProcessDefinition processDefinition)
Deletes the timer start events for the given process definition.- Parameters:
processDefinition
- the process definition
-
deleteSubscriptionsForProcessDefinition
public void deleteSubscriptionsForProcessDefinition(java.lang.String processDefinitionId)
Deletes the subscriptions for the process definition, which is identified by the given process definition id.- Parameters:
processDefinitionId
- the id of the process definition
-
deleteProcessDefinition
public void deleteProcessDefinition(ProcessDefinition processDefinition, java.lang.String processDefinitionId, boolean cascadeToHistory, boolean cascadeToInstances, boolean skipCustomListeners, boolean skipIoMappings)
Deletes the given process definition from the database and cache. If cascadeToHistory and cascadeToInstances is set to true it deletes the history and the process instances. *Note*: If more than one process definition, from one deployment, is deleted in a single transaction and the cascadeToHistory and cascadeToInstances flag was set to true it can cause a dirty deployment cache. The process instances of ALL process definitions must be deleted, before every process definition can be deleted! In such cases the cascadeToInstances flag have to set to false! On deletion of all process instances, the task listeners will be deleted as well. Deletion of tasks and listeners needs the redeployment of deployments. It can cause to problems if is done sequential with the deletion of process definition in a single transaction. *For example*: Deployment contains two process definition. First process definition and instances will be removed, also cleared from the cache. Second process definition will be removed and his instances. Deletion of instances will cause redeployment this deploys again first into the cache. Only the second will be removed from cache and first remains in the cache after the deletion process.- Parameters:
processDefinition
- the process definition which should be deletedprocessDefinitionId
- the id of the process definitioncascadeToHistory
- if true the history will deleted as wellcascadeToInstances
- if true the process instances are deleted as wellskipCustomListeners
- if true skips the custom listeners on deletion of instancesskipIoMappings
- specifies whether input/output mappings for tasks should be invoked
-
createDefaultAuthorizations
protected void createDefaultAuthorizations(ProcessDefinition processDefinition)
-
configureProcessDefinitionQuery
protected void configureProcessDefinitionQuery(ProcessDefinitionQueryImpl query)
-
configureParameterizedQuery
protected ListQueryParameterObject configureParameterizedQuery(java.lang.Object parameter)
-
findLatestDefinitionByKey
public ProcessDefinitionEntity findLatestDefinitionByKey(java.lang.String key)
- Specified by:
findLatestDefinitionByKey
in interfaceAbstractResourceDefinitionManager<ProcessDefinitionEntity>
-
findLatestDefinitionById
public ProcessDefinitionEntity findLatestDefinitionById(java.lang.String id)
- Specified by:
findLatestDefinitionById
in interfaceAbstractResourceDefinitionManager<ProcessDefinitionEntity>
-
getCachedResourceDefinitionEntity
public ProcessDefinitionEntity getCachedResourceDefinitionEntity(java.lang.String definitionId)
- Specified by:
getCachedResourceDefinitionEntity
in interfaceAbstractResourceDefinitionManager<ProcessDefinitionEntity>
-
findLatestDefinitionByKeyAndTenantId
public ProcessDefinitionEntity findLatestDefinitionByKeyAndTenantId(java.lang.String definitionKey, java.lang.String tenantId)
- Specified by:
findLatestDefinitionByKeyAndTenantId
in interfaceAbstractResourceDefinitionManager<ProcessDefinitionEntity>
-
findDefinitionByKeyVersionAndTenantId
public ProcessDefinitionEntity findDefinitionByKeyVersionAndTenantId(java.lang.String definitionKey, java.lang.Integer definitionVersion, java.lang.String tenantId)
- Specified by:
findDefinitionByKeyVersionAndTenantId
in interfaceAbstractResourceDefinitionManager<ProcessDefinitionEntity>
-
findDefinitionByKeyVersionTagAndTenantId
public ProcessDefinitionEntity findDefinitionByKeyVersionTagAndTenantId(java.lang.String definitionKey, java.lang.String definitionVersionTag, java.lang.String tenantId)
- Specified by:
findDefinitionByKeyVersionTagAndTenantId
in interfaceAbstractResourceDefinitionManager<ProcessDefinitionEntity>
-
findDefinitionByDeploymentAndKey
public ProcessDefinitionEntity findDefinitionByDeploymentAndKey(java.lang.String deploymentId, java.lang.String definitionKey)
- Specified by:
findDefinitionByDeploymentAndKey
in interfaceAbstractResourceDefinitionManager<ProcessDefinitionEntity>
-
-