public class BpmnDeployer extends AbstractDefinitionDeployer<ProcessDefinitionEntity>
Deployer
responsible to parse BPMN 2.0 XML files and create the proper
ProcessDefinitionEntity
s. 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
.Modifier and Type | Field and Description |
---|---|
static String[] |
BPMN_RESOURCE_SUFFIXES |
protected BpmnParser |
bpmnParser |
protected ExpressionManager |
expressionManager |
protected static PropertyMapKey<String,List<JobDeclaration<?,?>>> |
JOB_DECLARATIONS_PROPERTY |
static BpmnParseLogger |
LOG |
DIAGRAM_SUFFIXES, idGenerator
Constructor and Description |
---|
BpmnDeployer() |
Modifier and Type | Method and Description |
---|---|
protected void |
addAuthorizations(ProcessDefinitionEntity processDefinition) |
protected void |
addAuthorizationsFromIterator(Set<Expression> exprSet,
ProcessDefinitionEntity processDefinition,
org.camunda.bpm.engine.impl.bpmn.deployer.BpmnDeployer.ExprType exprType) |
protected void |
addConditionalStartEventSubscription(EventSubscriptionDeclaration conditionalEventDefinition,
ProcessDefinitionEntity processDefinition) |
protected void |
addDefinitionToDeploymentCache(DeploymentCache deploymentCache,
ProcessDefinitionEntity definition)
Add a definition to the deployment cache
|
protected void |
addEventSubscription(ProcessDefinitionEntity processDefinition,
EventSubscriptionDeclaration eventDefinition) |
void |
addEventSubscriptions(ProcessDefinitionEntity processDefinition) |
protected void |
addMessageStartEventSubscription(EventSubscriptionDeclaration messageEventDefinition,
ProcessDefinitionEntity processDefinition) |
protected void |
addSignalStartEventSubscription(EventSubscriptionDeclaration signalEventDefinition,
ProcessDefinitionEntity processDefinition) |
protected void |
addTimerDeclarations(ProcessDefinitionEntity processDefinition) |
protected void |
adjustStartEventSubscriptions(ProcessDefinitionEntity newLatestProcessDefinition,
ProcessDefinitionEntity oldLatestProcessDefinition)
adjust all event subscriptions responsible to start process instances
(timer start event, message start event).
|
protected void |
createJobDefinition(ProcessDefinition processDefinition,
JobDeclaration<?,?> jobDeclaration) |
protected void |
definitionAddedToDeploymentCache(DeploymentEntity deployment,
ProcessDefinitionEntity definition,
Properties properties)
Called after a definition was added to the deployment cache.
|
protected List<EventSubscriptionEntity> |
filterSubscriptionsOfDifferentType(EventSubscriptionDeclaration eventSubscription,
List<EventSubscriptionEntity> subscriptionsForSameMessageName)
It is possible to deploy a process containing a start and intermediate
message event that wait for the same message or to have two processes, one
with a message start event and the other one with a message intermediate
event, that subscribe for the same message.
|
protected ProcessDefinitionEntity |
findDefinitionByDeploymentAndKey(String deploymentId,
String definitionKey)
Find a definition entity by deployment id and definition key.
|
protected ProcessDefinitionEntity |
findLatestDefinitionByKeyAndTenantId(String definitionKey,
String tenantId)
Find the last deployed definition entity by definition key and tenant id.
|
BpmnParser |
getBpmnParser() |
protected DbEntityManager |
getDbEntityManager() |
protected EventSubscriptionManager |
getEventSubscriptionManager() |
ExpressionManager |
getExpressionManager() |
protected JobDefinitionManager |
getJobDefinitionManager() |
protected JobManager |
getJobManager() |
protected ProcessDefinitionManager |
getProcessDefinitionManager() |
protected String[] |
getResourcesSuffixes()
DON'T KEEP DEPLOYMENT-SPECIFIC STATE
|
protected void |
handlePersistedDefinition(ProcessDefinitionEntity definition,
ProcessDefinitionEntity persistedDefinition,
DeploymentEntity deployment,
Properties properties) |
protected boolean |
hasTenantId(EventSubscriptionEntity cachedSubscription,
String tenantId) |
protected boolean |
isSameMessageEventSubscriptionAlreadyPresent(EventSubscriptionDeclaration eventSubscription,
String tenantId) |
protected boolean |
isSubscriptionForIntermediateEvent(EventSubscriptionEntity subscriptionEntity) |
protected boolean |
isSubscriptionForStartEvent(EventSubscriptionEntity subscriptionEntity) |
protected boolean |
isSubscriptionOfDifferentTypeAsDeclaration(EventSubscriptionEntity subscriptionEntity,
EventSubscriptionDeclaration declaration) |
protected void |
persistDefinition(ProcessDefinitionEntity definition)
Persist definition entity into the database.
|
protected void |
persistedDefinitionLoaded(DeploymentEntity deployment,
ProcessDefinitionEntity definition,
ProcessDefinitionEntity persistedDefinition)
Called when a previous version of a definition was loaded from the persistent store.
|
protected void |
removeObsoleteEventSubscriptions(ProcessDefinitionEntity processDefinition,
ProcessDefinitionEntity latestProcessDefinition) |
protected void |
removeObsoleteTimers(ProcessDefinitionEntity processDefinition) |
void |
setBpmnParser(BpmnParser bpmnParser) |
void |
setExpressionManager(ExpressionManager expressionManager) |
protected List<ProcessDefinitionEntity> |
transformDefinitions(DeploymentEntity deployment,
ResourceEntity resource,
Properties properties)
Transform the resource entity into definition entities.
|
protected void |
updateJobDeclarations(List<JobDeclaration<?,?>> jobDeclarations,
ProcessDefinitionEntity processDefinition,
boolean isNewDeployment) |
deploy, ensureNoDuplicateDefinitionKeys, generateDefinitionId, getCommandContext, getDefinitionDiagramResourceName, getDeploymentCache, getDiagramResourceForDefinition, getDiagramSuffixes, getGeneralDiagramResourceName, getIdGenerator, getNextVersion, getProcessEngineConfiguration, isResourceHandled, loadDefinitions, parseDefinitionResources, persistDefinitions, postProcessDefinitions, registerDefinition, setIdGenerator, stripDefinitionFileSuffix, transformResource, updateDefinitionByLatestDefinition, updateDefinitionByPersistedDefinition
public static BpmnParseLogger LOG
public static final String[] BPMN_RESOURCE_SUFFIXES
protected static final PropertyMapKey<String,List<JobDeclaration<?,?>>> JOB_DECLARATIONS_PROPERTY
protected ExpressionManager expressionManager
protected BpmnParser bpmnParser
protected String[] getResourcesSuffixes()
getResourcesSuffixes
in class AbstractDefinitionDeployer<ProcessDefinitionEntity>
protected List<ProcessDefinitionEntity> transformDefinitions(DeploymentEntity deployment, ResourceEntity resource, Properties properties)
AbstractDefinitionDeployer
transformDefinitions
in class AbstractDefinitionDeployer<ProcessDefinitionEntity>
deployment
- the deployment the resources belongs toresource
- the resource to transformprotected ProcessDefinitionEntity findDefinitionByDeploymentAndKey(String deploymentId, String definitionKey)
AbstractDefinitionDeployer
findDefinitionByDeploymentAndKey
in class AbstractDefinitionDeployer<ProcessDefinitionEntity>
deploymentId
- the deployment iddefinitionKey
- the definition keyprotected ProcessDefinitionEntity findLatestDefinitionByKeyAndTenantId(String definitionKey, String tenantId)
AbstractDefinitionDeployer
findLatestDefinitionByKeyAndTenantId
in class AbstractDefinitionDeployer<ProcessDefinitionEntity>
protected void persistDefinition(ProcessDefinitionEntity definition)
AbstractDefinitionDeployer
persistDefinition
in class AbstractDefinitionDeployer<ProcessDefinitionEntity>
definition
- the definition entityprotected void addDefinitionToDeploymentCache(DeploymentCache deploymentCache, ProcessDefinitionEntity definition)
AbstractDefinitionDeployer
addDefinitionToDeploymentCache
in class AbstractDefinitionDeployer<ProcessDefinitionEntity>
deploymentCache
- the deployment cachedefinition
- the definition to addprotected void definitionAddedToDeploymentCache(DeploymentEntity deployment, ProcessDefinitionEntity definition, Properties properties)
AbstractDefinitionDeployer
definitionAddedToDeploymentCache
in class AbstractDefinitionDeployer<ProcessDefinitionEntity>
deployment
- the deployment of the definitiondefinition
- the definition entityprotected void persistedDefinitionLoaded(DeploymentEntity deployment, ProcessDefinitionEntity definition, ProcessDefinitionEntity persistedDefinition)
AbstractDefinitionDeployer
persistedDefinitionLoaded
in class AbstractDefinitionDeployer<ProcessDefinitionEntity>
deployment
- the deployment of the definitiondefinition
- the definition entitypersistedDefinition
- the loaded definition entityprotected void handlePersistedDefinition(ProcessDefinitionEntity definition, ProcessDefinitionEntity persistedDefinition, DeploymentEntity deployment, Properties properties)
handlePersistedDefinition
in class AbstractDefinitionDeployer<ProcessDefinitionEntity>
protected void updateJobDeclarations(List<JobDeclaration<?,?>> jobDeclarations, ProcessDefinitionEntity processDefinition, boolean isNewDeployment)
protected void createJobDefinition(ProcessDefinition processDefinition, JobDeclaration<?,?> jobDeclaration)
protected void adjustStartEventSubscriptions(ProcessDefinitionEntity newLatestProcessDefinition, ProcessDefinitionEntity oldLatestProcessDefinition)
protected void addTimerDeclarations(ProcessDefinitionEntity processDefinition)
protected void removeObsoleteTimers(ProcessDefinitionEntity processDefinition)
protected void removeObsoleteEventSubscriptions(ProcessDefinitionEntity processDefinition, ProcessDefinitionEntity latestProcessDefinition)
public void addEventSubscriptions(ProcessDefinitionEntity processDefinition)
protected void addEventSubscription(ProcessDefinitionEntity processDefinition, EventSubscriptionDeclaration eventDefinition)
protected void addMessageStartEventSubscription(EventSubscriptionDeclaration messageEventDefinition, ProcessDefinitionEntity processDefinition)
protected boolean isSameMessageEventSubscriptionAlreadyPresent(EventSubscriptionDeclaration eventSubscription, String tenantId)
protected boolean hasTenantId(EventSubscriptionEntity cachedSubscription, String tenantId)
protected List<EventSubscriptionEntity> filterSubscriptionsOfDifferentType(EventSubscriptionDeclaration eventSubscription, List<EventSubscriptionEntity> subscriptionsForSameMessageName)
eventSubscription
- subscriptionsForSameMessageName
- protected boolean isSubscriptionOfDifferentTypeAsDeclaration(EventSubscriptionEntity subscriptionEntity, EventSubscriptionDeclaration declaration)
protected boolean isSubscriptionForStartEvent(EventSubscriptionEntity subscriptionEntity)
protected boolean isSubscriptionForIntermediateEvent(EventSubscriptionEntity subscriptionEntity)
protected void addSignalStartEventSubscription(EventSubscriptionDeclaration signalEventDefinition, ProcessDefinitionEntity processDefinition)
protected void addConditionalStartEventSubscription(EventSubscriptionDeclaration conditionalEventDefinition, ProcessDefinitionEntity processDefinition)
protected void addAuthorizationsFromIterator(Set<Expression> exprSet, ProcessDefinitionEntity processDefinition, org.camunda.bpm.engine.impl.bpmn.deployer.BpmnDeployer.ExprType exprType)
protected void addAuthorizations(ProcessDefinitionEntity processDefinition)
protected DbEntityManager getDbEntityManager()
protected JobManager getJobManager()
protected JobDefinitionManager getJobDefinitionManager()
protected EventSubscriptionManager getEventSubscriptionManager()
protected ProcessDefinitionManager getProcessDefinitionManager()
public ExpressionManager getExpressionManager()
public void setExpressionManager(ExpressionManager expressionManager)
public BpmnParser getBpmnParser()
public void setBpmnParser(BpmnParser bpmnParser)
Copyright © 2021. All rights reserved.