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 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcascadeDeleteHistoryForProcessDefinition(String processDefinitionId) Cascades the deletion of a process definition to the history, deletes the history.protected voidcascadeDeleteProcessInstancesForProcessDefinition(String processDefinitionId, boolean skipCustomListeners, boolean skipIoMappings) Cascades the deletion of the process definition to the process instances.protected ListQueryParameterObjectconfigureParameterizedQuery(Object parameter) protected voidprotected voidcreateDefaultAuthorizations(ProcessDefinition processDefinition) voiddeleteProcessDefinition(ProcessDefinition processDefinition, String processDefinitionId, boolean cascadeToHistory, boolean cascadeToInstances, boolean skipCustomListeners, boolean skipIoMappings) Deletes the given process definition from the database and cache.voiddeleteSubscriptionsForProcessDefinition(String processDefinitionId) Deletes the subscriptions for the process definition, which is identified by the given process definition id.protected voiddeleteTimerStartEventsForProcessDefinition(ProcessDefinition processDefinition) Deletes the timer start events for the given process definition.findDefinitionByDeploymentAndKey(String deploymentId, String definitionKey) findDefinitionByKeyVersionAndTenantId(String definitionKey, Integer definitionVersion, String tenantId) findDefinitionByKeyVersionTagAndTenantId(String definitionKey, String definitionVersionTag, String tenantId) findDefinitionsByIds(Set<String> processDefinitionIds) findDefinitionsByKeyAndTenantId(String processDefinitionKey, String tenantId, boolean isTenantIdSet) findLatestDefinitionByKeyAndTenantId(String definitionKey, String tenantId) findLatestProcessDefinitionById(String processDefinitionId) findLatestProcessDefinitionByKey(String processDefinitionKey) findLatestProcessDefinitionByKeyAndTenantId(String processDefinitionKey, String tenantId) findLatestProcessDefinitionsByKey(String processDefinitionKey) findPreviousProcessDefinitionId(String processDefinitionKey, Integer version, String tenantId) findProcessDefinitionByDeploymentAndKey(String deploymentId, String processDefinitionKey) findProcessDefinitionByKeyVersionAndTenantId(String processDefinitionKey, Integer processDefinitionVersion, String tenantId) protected ProcessDefinitionEntityfindProcessDefinitionByKeyVersionOrVersionTag(String processDefinitionKey, Integer processDefinitionVersion, String processDefinitionVersionTag, String tenantId) findProcessDefinitionByKeyVersionTagAndTenantId(String processDefinitionKey, String processDefinitionVersionTag, String tenantId) longfindProcessDefinitionCountByQueryCriteria(ProcessDefinitionQueryImpl processDefinitionQuery) findProcessDefinitionsByDeploymentId(String deploymentId) findProcessDefinitionsByKey(String processDefinitionKey) findProcessDefinitionsByKeyIn(String... keys) findProcessDefinitionsByQueryCriteria(ProcessDefinitionQueryImpl processDefinitionQuery, Page page) getCachedResourceDefinitionEntity(String definitionId) voidinsertProcessDefinition(ProcessDefinitionEntity processDefinition) voidupdateProcessDefinitionSuspensionStateById(String processDefinitionId, SuspensionState suspensionState) voidupdateProcessDefinitionSuspensionStateByKey(String processDefinitionKey, SuspensionState suspensionState) voidupdateProcessDefinitionSuspensionStateByKeyAndTenantId(String processDefinitionKey, 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 Details
-
LOG
-
-
Constructor Details
-
ProcessDefinitionManager
public ProcessDefinitionManager()
-
-
Method Details
-
insertProcessDefinition
-
findLatestProcessDefinitionByKey
- 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:
-
findLatestProcessDefinitionsByKey
- 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:
-
findLatestProcessDefinitionByKeyAndTenantId
public ProcessDefinitionEntity findLatestProcessDefinitionByKeyAndTenantId(String processDefinitionKey, String tenantId) - Returns:
- the latest version of the process definition with the given key and tenant id
- See Also:
-
findLatestProcessDefinitionById
-
findProcessDefinitionsByQueryCriteria
public List<ProcessDefinition> findProcessDefinitionsByQueryCriteria(ProcessDefinitionQueryImpl processDefinitionQuery, Page page) -
findProcessDefinitionCountByQueryCriteria
public long findProcessDefinitionCountByQueryCriteria(ProcessDefinitionQueryImpl processDefinitionQuery) -
findProcessDefinitionByDeploymentAndKey
public ProcessDefinitionEntity findProcessDefinitionByDeploymentAndKey(String deploymentId, String processDefinitionKey) -
findProcessDefinitionByKeyVersionAndTenantId
public ProcessDefinitionEntity findProcessDefinitionByKeyVersionAndTenantId(String processDefinitionKey, Integer processDefinitionVersion, String tenantId) -
findProcessDefinitionByKeyVersionTagAndTenantId
public ProcessDefinitionEntity findProcessDefinitionByKeyVersionTagAndTenantId(String processDefinitionKey, String processDefinitionVersionTag, String tenantId) -
findProcessDefinitionByKeyVersionOrVersionTag
protected ProcessDefinitionEntity findProcessDefinitionByKeyVersionOrVersionTag(String processDefinitionKey, Integer processDefinitionVersion, String processDefinitionVersionTag, String tenantId) -
findProcessDefinitionsByKey
-
findProcessDefinitionsStartableByUser
-
findPreviousProcessDefinitionId
-
findProcessDefinitionsByDeploymentId
-
findProcessDefinitionsByKeyIn
-
findDefinitionsByKeyAndTenantId
public List<ProcessDefinition> findDefinitionsByKeyAndTenantId(String processDefinitionKey, String tenantId, boolean isTenantIdSet) -
findDefinitionsByIds
-
updateProcessDefinitionSuspensionStateById
public void updateProcessDefinitionSuspensionStateById(String processDefinitionId, SuspensionState suspensionState) -
updateProcessDefinitionSuspensionStateByKey
public void updateProcessDefinitionSuspensionStateByKey(String processDefinitionKey, SuspensionState suspensionState) -
updateProcessDefinitionSuspensionStateByKeyAndTenantId
public void updateProcessDefinitionSuspensionStateByKeyAndTenantId(String processDefinitionKey, String tenantId, SuspensionState suspensionState) -
cascadeDeleteProcessInstancesForProcessDefinition
protected void cascadeDeleteProcessInstancesForProcessDefinition(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
Cascades the deletion of a process definition to the history, deletes the history.- Parameters:
processDefinitionId- the process definition id
-
deleteTimerStartEventsForProcessDefinition
Deletes the timer start events for the given process definition.- Parameters:
processDefinition- the process definition
-
deleteSubscriptionsForProcessDefinition
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, 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
-
configureProcessDefinitionQuery
-
configureParameterizedQuery
-
findLatestDefinitionByKey
- Specified by:
findLatestDefinitionByKeyin interfaceAbstractResourceDefinitionManager<ProcessDefinitionEntity>
-
findLatestDefinitionById
- Specified by:
findLatestDefinitionByIdin interfaceAbstractResourceDefinitionManager<ProcessDefinitionEntity>
-
getCachedResourceDefinitionEntity
- Specified by:
getCachedResourceDefinitionEntityin interfaceAbstractResourceDefinitionManager<ProcessDefinitionEntity>
-
findLatestDefinitionByKeyAndTenantId
public ProcessDefinitionEntity findLatestDefinitionByKeyAndTenantId(String definitionKey, String tenantId) - Specified by:
findLatestDefinitionByKeyAndTenantIdin interfaceAbstractResourceDefinitionManager<ProcessDefinitionEntity>
-
findDefinitionByKeyVersionAndTenantId
public ProcessDefinitionEntity findDefinitionByKeyVersionAndTenantId(String definitionKey, Integer definitionVersion, String tenantId) - Specified by:
findDefinitionByKeyVersionAndTenantIdin interfaceAbstractResourceDefinitionManager<ProcessDefinitionEntity>
-
findDefinitionByKeyVersionTagAndTenantId
public ProcessDefinitionEntity findDefinitionByKeyVersionTagAndTenantId(String definitionKey, String definitionVersionTag, String tenantId) - Specified by:
findDefinitionByKeyVersionTagAndTenantIdin interfaceAbstractResourceDefinitionManager<ProcessDefinitionEntity>
-
findDefinitionByDeploymentAndKey
public ProcessDefinitionEntity findDefinitionByDeploymentAndKey(String deploymentId, String definitionKey) - Specified by:
findDefinitionByDeploymentAndKeyin interfaceAbstractResourceDefinitionManager<ProcessDefinitionEntity>
-