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 |
addDefinitionToDeploymentCache(DeploymentCache deploymentCache,
ProcessDefinitionEntity definition)
Add a definition to the deployment cache
|
protected void |
addEventSubscription(ProcessDefinitionEntity processDefinition,
EventSubscriptionDeclaration messageEventDefinition) |
protected void |
addEventSubscriptions(ProcessDefinitionEntity processDefinition) |
protected void |
addMessageEventSubscription(EventSubscriptionDeclaration messageEventDefinition,
ProcessDefinitionEntity processDefinition) |
protected void |
addSignalEventSubscription(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 |
createResource(String name,
byte[] bytes,
DeploymentEntity deploymentEntity) |
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 |
findLatestDefinitionByKey(String definitionKey)
Find the last deployed definition entity by definition key.
|
protected String |
generateDiagramResourceForDefinition(DeploymentEntity deployment,
String resourceName,
ProcessDefinitionEntity definition,
Map<String,ResourceEntity> resources)
Generate a diagram resource for a definition and return the name of the image resource.
|
BpmnParser |
getBpmnParser() |
protected DbEntityManager |
getDbEntityManager() |
protected EventSubscriptionManager |
getEventSubscriptionManager() |
ExpressionManager |
getExpressionManager() |
protected JobDefinitionManager |
getJobDefinitionManager() |
protected JobManager |
getJobManager() |
protected ProcessDefinitionManager |
getProcessDefinitionManager() |
protected String[] |
getResourcesSuffixes()
FURTHER MEMBERS ARE NOT ALLOWED
|
protected boolean |
isSameMessageEventSubscriptionAlreadyPresent(EventSubscriptionDeclaration eventSubscription) |
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 findLatestDefinitionByKey(String definitionKey)
AbstractDefinitionDeployer
findLatestDefinitionByKey
in class AbstractDefinitionDeployer<ProcessDefinitionEntity>
definitionKey
- the definition keyprotected 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 String generateDiagramResourceForDefinition(DeploymentEntity deployment, String resourceName, ProcessDefinitionEntity definition, Map<String,ResourceEntity> resources)
AbstractDefinitionDeployer
generateDiagramResourceForDefinition
in class AbstractDefinitionDeployer<ProcessDefinitionEntity>
deployment
- the deployment entityresourceName
- the name of the definition resourcedefinition
- the definition entityresources
- the resources of the deploymentprotected 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 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)
protected void addEventSubscriptions(ProcessDefinitionEntity processDefinition)
protected void addEventSubscription(ProcessDefinitionEntity processDefinition, EventSubscriptionDeclaration messageEventDefinition)
protected void addMessageEventSubscription(EventSubscriptionDeclaration messageEventDefinition, ProcessDefinitionEntity processDefinition)
protected boolean isSameMessageEventSubscriptionAlreadyPresent(EventSubscriptionDeclaration eventSubscription)
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 addSignalEventSubscription(EventSubscriptionDeclaration signalEventDefinition, 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 void createResource(String name, byte[] bytes, DeploymentEntity deploymentEntity)
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 © 2018. All rights reserved.