Class BpmnDeploymentHelper
- java.lang.Object
-
- org.activiti.engine.impl.bpmn.deployer.BpmnDeploymentHelper
-
public class BpmnDeploymentHelper extends java.lang.ObjectMethods for working with deployments. Much of the actual work ofBpmnDeployeris done by orchestrating the different pieces of work this class does; by having them here, we allow other deployers to make use of them.
-
-
Field Summary
Fields Modifier and Type Field Description protected EventSubscriptionManagereventSubscriptionManagerprotected TimerManagertimerManager
-
Constructor Summary
Constructors Constructor Description BpmnDeploymentHelper()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddAuthorizationsForNewProcessDefinition(org.activiti.bpmn.model.Process process, ProcessDefinitionEntity processDefinition)protected voidaddAuthorizationsFromIterator(CommandContext commandContext, java.util.List<java.lang.String> expressions, ProcessDefinitionEntity processDefinition, org.activiti.engine.impl.bpmn.deployer.BpmnDeploymentHelper.ExpressionType expressionType)voidcopyDeploymentValuesToProcessDefinitions(DeploymentEntity deployment, java.util.List<ProcessDefinitionEntity> processDefinitions)Updates all the process definition entities to match the deployment's values for tenant, engine version, and deployment id.EventSubscriptionManagergetEventSubscriptionManager()ProcessDefinitionEntitygetMostRecentVersionOfProcessDefinition(ProcessDefinitionEntity processDefinition)Gets the most recent persisted process definition that matches this one for tenant and key.ProcessDefinitionEntitygetPersistedInstanceOfProcessDefinition(ProcessDefinitionEntity processDefinition)Gets the persisted version of the already-deployed process definition.TimerManagergetTimerManager()voidsetEventSubscriptionManager(EventSubscriptionManager eventSubscriptionManager)voidsetResourceNamesOnProcessDefinitions(ParsedDeployment parsedDeployment)Updates all the process definition entities to have the correct resource names.voidsetTimerManager(TimerManager timerManager)voidupdateTimersAndEvents(ProcessDefinitionEntity processDefinition, ProcessDefinitionEntity previousProcessDefinition, ParsedDeployment parsedDeployment)Updates all timers and events for the process definition.voidverifyProcessDefinitionsDoNotShareKeys(java.util.Collection<ProcessDefinitionEntity> processDefinitions)Verifies that no two process definitions share the same key, to prevent database unique index violation.
-
-
-
Field Detail
-
timerManager
protected TimerManager timerManager
-
eventSubscriptionManager
protected EventSubscriptionManager eventSubscriptionManager
-
-
Method Detail
-
verifyProcessDefinitionsDoNotShareKeys
public void verifyProcessDefinitionsDoNotShareKeys(java.util.Collection<ProcessDefinitionEntity> processDefinitions)
Verifies that no two process definitions share the same key, to prevent database unique index violation.- Throws:
ActivitiException- if any two processes have the same key
-
copyDeploymentValuesToProcessDefinitions
public void copyDeploymentValuesToProcessDefinitions(DeploymentEntity deployment, java.util.List<ProcessDefinitionEntity> processDefinitions)
Updates all the process definition entities to match the deployment's values for tenant, engine version, and deployment id.
-
setResourceNamesOnProcessDefinitions
public void setResourceNamesOnProcessDefinitions(ParsedDeployment parsedDeployment)
Updates all the process definition entities to have the correct resource names.
-
getMostRecentVersionOfProcessDefinition
public ProcessDefinitionEntity getMostRecentVersionOfProcessDefinition(ProcessDefinitionEntity processDefinition)
Gets the most recent persisted process definition that matches this one for tenant and key. If none is found, returns null. This method assumes that the tenant and key are properly set on the process definition entity.
-
getPersistedInstanceOfProcessDefinition
public ProcessDefinitionEntity getPersistedInstanceOfProcessDefinition(ProcessDefinitionEntity processDefinition)
Gets the persisted version of the already-deployed process definition. Note that this is different fromgetMostRecentVersionOfProcessDefinition(org.activiti.engine.impl.persistence.entity.ProcessDefinitionEntity)as it looks specifically for a process definition that is already persisted and attached to a particular deployment, rather than the latest version across all deployments.
-
updateTimersAndEvents
public void updateTimersAndEvents(ProcessDefinitionEntity processDefinition, ProcessDefinitionEntity previousProcessDefinition, ParsedDeployment parsedDeployment)
Updates all timers and events for the process definition. This removes obsolete message and signal subscriptions and timers, and adds new ones.
-
addAuthorizationsForNewProcessDefinition
public void addAuthorizationsForNewProcessDefinition(org.activiti.bpmn.model.Process process, ProcessDefinitionEntity processDefinition)- Parameters:
processDefinition-
-
addAuthorizationsFromIterator
protected void addAuthorizationsFromIterator(CommandContext commandContext, java.util.List<java.lang.String> expressions, ProcessDefinitionEntity processDefinition, org.activiti.engine.impl.bpmn.deployer.BpmnDeploymentHelper.ExpressionType expressionType)
-
getTimerManager
public TimerManager getTimerManager()
-
setTimerManager
public void setTimerManager(TimerManager timerManager)
-
getEventSubscriptionManager
public EventSubscriptionManager getEventSubscriptionManager()
-
setEventSubscriptionManager
public void setEventSubscriptionManager(EventSubscriptionManager eventSubscriptionManager)
-
-