Class BpmnDeploymentHelper

java.lang.Object
org.flowable.engine.impl.bpmn.deployer.BpmnDeploymentHelper

public class BpmnDeploymentHelper extends Object
Methods for working with deployments. Much of the actual work of BpmnDeployer is done by orchestrating the different pieces of work this class does; by having them here, we allow other deployers to make use of them.
  • Constructor Details

    • BpmnDeploymentHelper

      public BpmnDeploymentHelper()
  • Method Details

    • verifyProcessDefinitionsDoNotShareKeys

      public void verifyProcessDefinitionsDoNotShareKeys(Collection<ProcessDefinitionEntity> processDefinitions)
      Verifies that no two process definitions share the same key, to prevent database unique index violation.
      Throws:
      FlowableException - if any two processes have the same key
    • copyDeploymentValuesToProcessDefinitions

      public void copyDeploymentValuesToProcessDefinitions(DeploymentEntity deployment, 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.
    • getMostRecentDerivedVersionOfProcessDefinition

      public ProcessDefinitionEntity getMostRecentDerivedVersionOfProcessDefinition(ProcessDefinitionEntity processDefinition)
      Gets the most recent persisted derived 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 from getMostRecentVersionOfProcessDefinition(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. The undeploy half iterates the previous process definition's top-level start events; each behavior either does its own per-start-event work (e.g. the EventRegistry "manual" re-point) or registers an obsolete event subscription / timer job handler type with the context. After the undeploy iteration the deployer issues one mass-delete per unique registered type — fewer DB round-trips than per-start-event deletes, and tighter than the historical fixed Message+Signal+EventRegistry sweep that always ran regardless of which types the previous process definition used. The deploy half then iterates the new process definition's top-level start events to register the new artifacts.
    • deleteObsoleteEventSubscriptions

      protected void deleteObsoleteEventSubscriptions(ProcessDefinitionEntity processDefinition, Collection<String> eventHandlerTypes, ProcessEngineConfigurationImpl processEngineConfiguration)
    • cancelObsoleteTimerJobs

      protected void cancelObsoleteTimerJobs(ProcessDefinitionEntity processDefinition, String timerJobHandlerType, ProcessEngineConfigurationImpl processEngineConfiguration, CommandContext commandContext)
    • forEachTopLevelStartEventBehavior

      protected void forEachTopLevelStartEventBehavior(Process process, BpmnDeploymentHelper.StartEventBehaviorVisitor visitor)
    • addAuthorizationsForNewProcessDefinition

      public void addAuthorizationsForNewProcessDefinition(Process process, ProcessDefinitionEntity processDefinition)
      Parameters:
      processDefinition -
    • addAuthorizationsFromIterator

      protected void addAuthorizationsFromIterator(CommandContext commandContext, List<String> expressions, ProcessDefinitionEntity processDefinition, org.flowable.engine.impl.bpmn.deployer.BpmnDeploymentHelper.ExpressionType expressionType)