public class BpmnDeployer extends Object implements Deployer
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 |
static String[] |
DIAGRAM_SUFFIXES |
protected ExpressionManager |
expressionManager |
protected IdGenerator |
idGenerator |
Constructor and Description |
---|
BpmnDeployer() |
Modifier and Type | Method and Description |
---|---|
protected void |
addAuthorizations(ProcessDefinitionEntity processDefinition) |
protected void |
addMessageEventSubscriptions(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) |
void |
deploy(DeploymentEntity deployment) |
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 String |
getBpmnFileImageResourceName(String bpmnFileResource,
String diagramSuffix) |
BpmnParser |
getBpmnParser() |
protected String |
getDiagramResourceForProcess(String bpmnFileResource,
String processKey,
Map<String,ResourceEntity> resources)
Returns the default name of the image resource for a certain process.
|
ExpressionManager |
getExpressionManager() |
IdGenerator |
getIdGenerator() |
protected String |
getProcessDefinitionId(DeploymentEntity deployment,
ProcessDefinitionEntity processDefinition)
create an id for the process definition.
|
protected String |
getProcessImageResourceName(String bpmnFileResource,
String processKey,
String diagramSuffix) |
protected int |
getVersionForNewProcessDefinition(DeploymentEntity deployment,
ProcessDefinitionEntity newProcessDefinition,
ProcessDefinitionEntity latestProcessDefinition)
per default we increment the latest process definition by one - but you
might want to hook in some own logic here, e.g.
|
protected boolean |
isBpmnResource(String resourceName) |
protected boolean |
isSubscriptionForIntermediateEvent(EventSubscriptionEntity subscriptionEntity) |
protected boolean |
isSubscriptionForStartEvent(EventSubscriptionEntity subscriptionEntity) |
protected void |
removeObsoleteMessageEventSubscriptions(ProcessDefinitionEntity processDefinition,
ProcessDefinitionEntity latestProcessDefinition) |
protected void |
removeObsoleteTimers(ProcessDefinitionEntity processDefinition) |
void |
setBpmnParser(BpmnParser bpmnParser) |
void |
setExpressionManager(ExpressionManager expressionManager) |
void |
setIdGenerator(IdGenerator idGenerator) |
protected String |
stripBpmnFileSuffix(String bpmnFileResource) |
protected void |
updateJobDeclarations(List<JobDeclaration<?>> jobDeclarations,
ProcessDefinition processDefinition,
boolean isNewDeployment) |
public static final String[] BPMN_RESOURCE_SUFFIXES
public static final String[] DIAGRAM_SUFFIXES
protected ExpressionManager expressionManager
protected BpmnParser bpmnParser
protected IdGenerator idGenerator
public void deploy(DeploymentEntity deployment)
protected void updateJobDeclarations(List<JobDeclaration<?>> jobDeclarations, ProcessDefinition processDefinition, boolean isNewDeployment)
protected void createJobDefinition(ProcessDefinition processDefinition, JobDeclaration<?> jobDeclaration)
protected void adjustStartEventSubscriptions(ProcessDefinitionEntity newLatestProcessDefinition, ProcessDefinitionEntity oldLatestProcessDefinition)
protected String getProcessDefinitionId(DeploymentEntity deployment, ProcessDefinitionEntity processDefinition)
IdGenerator
and add the process definition key and version if that does not exceed 64 characters.
You might want to hook in your own implemenation here.deployment
- protected int getVersionForNewProcessDefinition(DeploymentEntity deployment, ProcessDefinitionEntity newProcessDefinition, ProcessDefinitionEntity latestProcessDefinition)
protected void addTimerDeclarations(ProcessDefinitionEntity processDefinition)
protected void removeObsoleteTimers(ProcessDefinitionEntity processDefinition)
protected void removeObsoleteMessageEventSubscriptions(ProcessDefinitionEntity processDefinition, ProcessDefinitionEntity latestProcessDefinition)
protected void addMessageEventSubscriptions(ProcessDefinitionEntity processDefinition)
protected List<EventSubscriptionEntity> filterSubscriptionsOfDifferentType(EventSubscriptionDeclaration eventSubscription, List<EventSubscriptionEntity> subscriptionsForSameMessageName)
eventSubscription
- subscriptionsForSameMessageName
- protected boolean isSubscriptionForStartEvent(EventSubscriptionEntity subscriptionEntity)
protected boolean isSubscriptionForIntermediateEvent(EventSubscriptionEntity subscriptionEntity)
protected void addAuthorizations(ProcessDefinitionEntity processDefinition)
protected String getDiagramResourceForProcess(String bpmnFileResource, String processKey, Map<String,ResourceEntity> resources)
protected String getBpmnFileImageResourceName(String bpmnFileResource, String diagramSuffix)
protected String getProcessImageResourceName(String bpmnFileResource, String processKey, String diagramSuffix)
protected void createResource(String name, byte[] bytes, DeploymentEntity deploymentEntity)
protected boolean isBpmnResource(String resourceName)
public ExpressionManager getExpressionManager()
public void setExpressionManager(ExpressionManager expressionManager)
public BpmnParser getBpmnParser()
public void setBpmnParser(BpmnParser bpmnParser)
public IdGenerator getIdGenerator()
public void setIdGenerator(IdGenerator idGenerator)
Copyright © 2018. All rights reserved.