Class BpmnDeployer
java.lang.Object
org.camunda.bpm.engine.impl.AbstractDefinitionDeployer<ProcessDefinitionEntity>
org.camunda.bpm.engine.impl.bpmn.deployer.BpmnDeployer
- All Implemented Interfaces:
Deployer
Deployer responsible to parse BPMN 2.0 XML files and create the proper
ProcessDefinitionEntitys. Overwrite this class if you want to gain some control over
this mechanism, e.g. setting different version numbers, or you want to use your own BpmnParser.- Author:
- Tom Baeyens, Joram Barrez, Bernd Ruecker
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String[]protected BpmnParserprotected ExpressionManagerprotected static final PropertyMapKey<String,List<JobDeclaration<?, ?>>> static BpmnParseLoggerFields inherited from class org.camunda.bpm.engine.impl.AbstractDefinitionDeployer
DIAGRAM_SUFFIXES, idGenerator -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddAuthorizations(ProcessDefinitionEntity processDefinition) protected voidaddAuthorizationsFromIterator(Set<Expression> exprSet, ProcessDefinitionEntity processDefinition, org.camunda.bpm.engine.impl.bpmn.deployer.BpmnDeployer.ExprType exprType) protected voidaddConditionalStartEventSubscription(EventSubscriptionDeclaration conditionalEventDefinition, ProcessDefinitionEntity processDefinition) protected voidaddDefinitionToDeploymentCache(DeploymentCache deploymentCache, ProcessDefinitionEntity definition) Add a definition to the deployment cacheprotected voidaddEventSubscription(ProcessDefinitionEntity processDefinition, EventSubscriptionDeclaration eventDefinition) voidaddEventSubscriptions(ProcessDefinitionEntity processDefinition) protected voidaddMessageStartEventSubscription(EventSubscriptionDeclaration messageEventDefinition, ProcessDefinitionEntity processDefinition) protected voidaddSignalStartEventSubscription(EventSubscriptionDeclaration signalEventDefinition, ProcessDefinitionEntity processDefinition) voidaddTimerDeclarations(ProcessDefinitionEntity processDefinition) protected voidadjustStartEventSubscriptions(ProcessDefinitionEntity newLatestProcessDefinition, ProcessDefinitionEntity oldLatestProcessDefinition) adjust all event subscriptions responsible to start process instances (timer start event, message start event).protected voidcreateJobDefinition(ProcessDefinition processDefinition, JobDeclaration<?, ?> jobDeclaration) protected voiddefinitionAddedToDeploymentCache(DeploymentEntity deployment, ProcessDefinitionEntity definition, Properties properties) Called after a definition was added to the deployment cache.protected ProcessDefinitionEntityfindDefinitionByDeploymentAndKey(String deploymentId, String definitionKey) Find a definition entity by deployment id and definition key.protected ProcessDefinitionEntityfindLatestDefinitionByKeyAndTenantId(String definitionKey, String tenantId) Find the last deployed definition entity by definition key and tenant id.protected DbEntityManagerprotected EventSubscriptionManagerprotected JobDefinitionManagerprotected JobManagerprotected List<EventSubscriptionEntity>getOrphanSubscriptionEvents(ProcessDefinitionEntity processDefinition) protected List<EventSubscriptionEntity>getPreviousSubscriptionEvents(ProcessDefinitionEntity latestProcessDefinition) protected ProcessDefinitionManagerprotected String[]<!> DON'T KEEP DEPLOYMENT-SPECIFIC STATE <!>protected voidhandlePersistedDefinition(ProcessDefinitionEntity definition, ProcessDefinitionEntity persistedDefinition, DeploymentEntity deployment, Properties properties) protected booleanhasTenantId(EventSubscriptionEntity cachedSubscription, String tenantId) protected booleanisOrphan(EventSubscriptionEntity entity) protected booleanisSameMessageStartEventSubscriptionAlreadyPresent(EventSubscriptionDeclaration eventSubscription, String tenantId) protected booleanisSubscriptionForIntermediateEvent(EventSubscriptionEntity subscriptionEntity) protected booleanisSubscriptionForStartEvent(EventSubscriptionEntity subscriptionEntity) protected booleanisSubscriptionOfDifferentTypeAsDeclaration(EventSubscriptionEntity subscriptionEntity, EventSubscriptionDeclaration declaration) protected voidpersistDefinition(ProcessDefinitionEntity definition) Persist definition entity into the database.protected voidpersistedDefinitionLoaded(DeploymentEntity deployment, ProcessDefinitionEntity definition, ProcessDefinitionEntity persistedDefinition) Called when a previous version of a definition was loaded from the persistent store.protected voidremoveObsoleteEventSubscriptions(ProcessDefinitionEntity newLatestProcessDefinition, ProcessDefinitionEntity latestProcessDefinition) protected voidremoveObsoleteTimers(ProcessDefinitionEntity processDefinition) voidsetBpmnParser(BpmnParser bpmnParser) voidsetExpressionManager(ExpressionManager expressionManager) protected List<ProcessDefinitionEntity>transformDefinitions(DeploymentEntity deployment, ResourceEntity resource, Properties properties) Transform the resource entity into definition entities.protected voidupdateJobDeclarations(List<JobDeclaration<?, ?>> jobDeclarations, ProcessDefinitionEntity processDefinition, boolean isNewDeployment) Methods inherited from class org.camunda.bpm.engine.impl.AbstractDefinitionDeployer
deploy, ensureNoDuplicateDefinitionKeys, generateDefinitionId, getCommandContext, getDefinitionDiagramResourceName, getDeploymentCache, getDiagramResourceForDefinition, getDiagramSuffixes, getGeneralDiagramResourceName, getIdGenerator, getNextVersion, getProcessEngineConfiguration, isResourceHandled, loadDefinitions, parseDefinitionResources, persistDefinitions, postProcessDefinitions, registerDefinition, setIdGenerator, stripDefinitionFileSuffix, transformResource, updateDefinitionByLatestDefinition, updateDefinitionByPersistedDefinition
-
Field Details
-
LOG
-
BPMN_RESOURCE_SUFFIXES
-
JOB_DECLARATIONS_PROPERTY
-
expressionManager
-
bpmnParser
-
-
Constructor Details
-
BpmnDeployer
public BpmnDeployer()
-
-
Method Details
-
getResourcesSuffixes
<!> DON'T KEEP DEPLOYMENT-SPECIFIC STATE <!>- Specified by:
getResourcesSuffixesin classAbstractDefinitionDeployer<ProcessDefinitionEntity>- Returns:
- the list of resource suffixes for this cacheDeployer
-
transformDefinitions
protected List<ProcessDefinitionEntity> transformDefinitions(DeploymentEntity deployment, ResourceEntity resource, Properties properties) Description copied from class:AbstractDefinitionDeployerTransform the resource entity into definition entities.- Specified by:
transformDefinitionsin classAbstractDefinitionDeployer<ProcessDefinitionEntity>- Parameters:
deployment- the deployment the resources belongs toresource- the resource to transform- Returns:
- a list of transformed definition entities
-
findDefinitionByDeploymentAndKey
protected ProcessDefinitionEntity findDefinitionByDeploymentAndKey(String deploymentId, String definitionKey) Description copied from class:AbstractDefinitionDeployerFind a definition entity by deployment id and definition key.- Specified by:
findDefinitionByDeploymentAndKeyin classAbstractDefinitionDeployer<ProcessDefinitionEntity>- Parameters:
deploymentId- the deployment iddefinitionKey- the definition key- Returns:
- the corresponding definition entity or null if non is found
-
findLatestDefinitionByKeyAndTenantId
protected ProcessDefinitionEntity findLatestDefinitionByKeyAndTenantId(String definitionKey, String tenantId) Description copied from class:AbstractDefinitionDeployerFind the last deployed definition entity by definition key and tenant id.- Specified by:
findLatestDefinitionByKeyAndTenantIdin classAbstractDefinitionDeployer<ProcessDefinitionEntity>- Returns:
- the corresponding definition entity or null if non is found
-
persistDefinition
Description copied from class:AbstractDefinitionDeployerPersist definition entity into the database.- Specified by:
persistDefinitionin classAbstractDefinitionDeployer<ProcessDefinitionEntity>- Parameters:
definition- the definition entity
-
addDefinitionToDeploymentCache
protected void addDefinitionToDeploymentCache(DeploymentCache deploymentCache, ProcessDefinitionEntity definition) Description copied from class:AbstractDefinitionDeployerAdd a definition to the deployment cache- Specified by:
addDefinitionToDeploymentCachein classAbstractDefinitionDeployer<ProcessDefinitionEntity>- Parameters:
deploymentCache- the deployment cachedefinition- the definition to add
-
definitionAddedToDeploymentCache
protected void definitionAddedToDeploymentCache(DeploymentEntity deployment, ProcessDefinitionEntity definition, Properties properties) Description copied from class:AbstractDefinitionDeployerCalled after a definition was added to the deployment cache.- Overrides:
definitionAddedToDeploymentCachein classAbstractDefinitionDeployer<ProcessDefinitionEntity>- Parameters:
deployment- the deployment of the definitiondefinition- the definition entity
-
persistedDefinitionLoaded
protected void persistedDefinitionLoaded(DeploymentEntity deployment, ProcessDefinitionEntity definition, ProcessDefinitionEntity persistedDefinition) Description copied from class:AbstractDefinitionDeployerCalled when a previous version of a definition was loaded from the persistent store.- Overrides:
persistedDefinitionLoadedin classAbstractDefinitionDeployer<ProcessDefinitionEntity>- Parameters:
deployment- the deployment of the definitiondefinition- the definition entitypersistedDefinition- the loaded definition entity
-
handlePersistedDefinition
protected void handlePersistedDefinition(ProcessDefinitionEntity definition, ProcessDefinitionEntity persistedDefinition, DeploymentEntity deployment, Properties properties) - Overrides:
handlePersistedDefinitionin classAbstractDefinitionDeployer<ProcessDefinitionEntity>
-
updateJobDeclarations
protected void updateJobDeclarations(List<JobDeclaration<?, ?>> jobDeclarations, ProcessDefinitionEntity processDefinition, boolean isNewDeployment) -
createJobDefinition
protected void createJobDefinition(ProcessDefinition processDefinition, JobDeclaration<?, ?> jobDeclaration) -
adjustStartEventSubscriptions
protected void adjustStartEventSubscriptions(ProcessDefinitionEntity newLatestProcessDefinition, ProcessDefinitionEntity oldLatestProcessDefinition) adjust all event subscriptions responsible to start process instances (timer start event, message start event). The default behavior is to remove the old subscriptions and add new ones for the new deployed process definitions. -
addTimerDeclarations
-
removeObsoleteTimers
-
removeObsoleteEventSubscriptions
protected void removeObsoleteEventSubscriptions(ProcessDefinitionEntity newLatestProcessDefinition, ProcessDefinitionEntity latestProcessDefinition) -
getPreviousSubscriptionEvents
protected List<EventSubscriptionEntity> getPreviousSubscriptionEvents(ProcessDefinitionEntity latestProcessDefinition) -
getOrphanSubscriptionEvents
protected List<EventSubscriptionEntity> getOrphanSubscriptionEvents(ProcessDefinitionEntity processDefinition) -
isOrphan
-
addEventSubscriptions
-
addEventSubscription
protected void addEventSubscription(ProcessDefinitionEntity processDefinition, EventSubscriptionDeclaration eventDefinition) -
addMessageStartEventSubscription
protected void addMessageStartEventSubscription(EventSubscriptionDeclaration messageEventDefinition, ProcessDefinitionEntity processDefinition) -
isSameMessageStartEventSubscriptionAlreadyPresent
protected boolean isSameMessageStartEventSubscriptionAlreadyPresent(EventSubscriptionDeclaration eventSubscription, String tenantId) -
hasTenantId
-
isSubscriptionOfDifferentTypeAsDeclaration
protected boolean isSubscriptionOfDifferentTypeAsDeclaration(EventSubscriptionEntity subscriptionEntity, EventSubscriptionDeclaration declaration) -
isSubscriptionForStartEvent
-
isSubscriptionForIntermediateEvent
-
addSignalStartEventSubscription
protected void addSignalStartEventSubscription(EventSubscriptionDeclaration signalEventDefinition, ProcessDefinitionEntity processDefinition) -
addConditionalStartEventSubscription
protected void addConditionalStartEventSubscription(EventSubscriptionDeclaration conditionalEventDefinition, ProcessDefinitionEntity processDefinition) -
addAuthorizationsFromIterator
protected void addAuthorizationsFromIterator(Set<Expression> exprSet, ProcessDefinitionEntity processDefinition, org.camunda.bpm.engine.impl.bpmn.deployer.BpmnDeployer.ExprType exprType) -
addAuthorizations
-
getDbEntityManager
-
getJobManager
-
getJobDefinitionManager
-
getEventSubscriptionManager
-
getProcessDefinitionManager
-
getExpressionManager
-
setExpressionManager
-
getBpmnParser
-
setBpmnParser
-