Package jadex.bpmn.model
Class MBpmnModel
java.lang.Object
jadex.bpmn.model.MIdElement
jadex.bpmn.model.MAnnotationElement
jadex.bpmn.model.MBpmnModel
- All Implemented Interfaces:
jadex.model.ICacheableModel
Java representation of a bpmn model for xml description.
-
Field Summary
FieldsModifier and TypeFieldDescriptionThe cached activities of the model.The data edges.protected Map
<String, MSequenceEdge> The cached edges of the model.protected Map
<String, MMessagingEdge> The messaging edges.The incoming data edges for arguments.The artifacts.protected Map
<String, MIdElement> The association sources.protected Map
<String, MIdElement> The association targets.protected Map
<String, List<MNamedIdElement>> The configurations (config name -> start elements).static final String
Constant for event end cancellation.static final String
Constant for event end compensation.static final String
Constant for event end empty.static final String
Constant for event end error.static final String
Constant for event end message.static final String
Constant for event end signal.static final String
Constant for event end cancellation.static final String
Constant for event intermediate cancellation.static final String
Constant for event intermediate compensation.static final String
Constant for event start empty.static final String
Constant for event intermediate error.static final String
Constant for event intermediate message.static final String
Constant for event intermediate multiple.static final String
Constant for event intermediate rule.static final String
Constant for event intermediate signal.static final String
Constant for event intermediate timer.static final String
Constant for event start empty.static final String
Constant for event start message.static final String
Constant for event start multiple.static final String
Constant for event start rule.static final String
Constant for event start signal.static final String
Constant for event start timer.protected Map
<MSubProcess, List<MActivity>> The cached event subprocess start events of the model.The extensions.static final String
Constant for gateway data based exclusive.static final String
Constant for gateway data based exclusive.static final String
Constant for gateway parallel.protected boolean
The keep alive flag that allows processes to stay after end event.protected long
The last check date.protected long
The last modified date.protected List
<MMessagingEdge> The messages.protected jadex.model.modelinfo.ModelInfo
The model info.protected Map
<MIdElement, MIdElement> Parents of activities.The pools.static final String
Property name for error events.static final String
Property name for condition of rule events.static final String
Property name for event types of rule events.The outgoing data edges for results.static final String
The signal event handler trigger parameter name.static final String
Constant for sub process.static final String
Constant for task.static final String
The process trigger name.The cached type-matched start events of the model.protected Map
<String, MContextVariable> The context variables (name -> [class, initexpression]).The cached instance-matched events that require waiting.Fields inherited from class jadex.bpmn.model.MAnnotationElement
annotations
Fields inherited from class jadex.bpmn.model.MIdElement
id, ID_GENERATOR
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Internal add activity targets.void
addAllSubActivities
(MSubProcess proc, Map<String, MActivity> activities) Add all subactivities.void
addArgumentDataEdge
(MDataEdge edge) Add an incoming edge.void
addArtifact
(MArtifact artifact) Add an artifact.protected MArtifact
addArtifacts
(List<MArtifact> artifacts, Map<String, MIdElement> sources) Add artifacts.protected boolean
addAssociations
(String assosdesc, MIdElement target, Map<String, MIdElement> targets) Internal add associations.void
addContextVariable
(MContextVariable variable) Add a context variable declaration.protected void
addEdges
(List<MSequenceEdge> tmp, Map<String, MSequenceEdge> edges) Add edges to the result map.addExtension
(String name, Map<String, Object> ext) void
Add an import.void
addMessagingEdge
(MMessagingEdge message) Add a message edge.void
Add a pool.void
addResultDataEdge
(MDataEdge edge) Add an outgoing edge.void
addStartElement
(String config, MNamedIdElement element) Add a start element for a configurations.protected void
addSubProcesses
(MSubProcess subproc, Map<String, MIdElement> sources) Add sub processes.void
Clears the model caches if stale.jadex.common.Tuple2
<jadex.collection.BiHashMap<String, String>, List<MIdElement>> cloneElements
(Set<MIdElement> originals) Clones a set of elements.Get an activity by id.Get all activities.Get all association sources.Get all association targets.Get all data edges.Get all edges.protected void
getAllEdges
(MActivity act, Map<String, MSequenceEdge> edges) Internal get all edges.Get all message edges.Get all sequence edges.Get the incoming data edges.Get the artifacts.protected String[]
Get the configurations.getContextVariable
(String name) Get a declared context variable.jadex.common.UnparsedExpression
getContextVariableExpression
(String name, String config) Get the initialization expression of a declared context variable.Get the declared context variables.Returns a mapping from event subprocesses to their start events.Returns all start events in event subprocesses.getExtension
(String name) Get the filename.long
Get the last checked date.long
Get the lastmodified date.Get the message edges.jadex.model.modelinfo.IModelInfo
Get the model info.getName()
Get the name of the model.getParent
(MIdElement element) Gets the parent of an element.Get the pools.getPools()
Get the pools.Get the outgoing data edges.Get all start activities of the model.getStartActivities
(String poolname, String lanename) Get all start activities of the model.getStartActivities
(List<MActivity> activities) Get all start activities form the supplied set of activities.getStartElements
(String config) Get the pool lane.Returns all start events triggered based on type matching.Returns all events waiting for outside triggers.protected void
Initializes the type and instance event trigger caches.void
Init the model info.boolean
isContainedInParentSet
(Set<MIdElement> mmap, MIdElement idelem) Checks if an element or one of its parents is in a set.boolean
Get the keepalive.void
Remove an outgoing edge.void
removeArtifact
(MArtifact artifact) Remove an artifact.void
removeConfiguration
(String config) Removes a pool/lane activation for a configurations.void
removeContextVariable
(MContextVariable variable) Remove a context variable declaration.void
removeContextVariable
(String name) Remove a context variable declaration.void
removeMessagingEdge
(MMessagingEdge message) Remove a message edge.void
removePool
(MPool pool) Remove a pool.void
Remove an outgoing edge.void
removeStartElement
(String config, MNamedIdElement element) Removes a pool/lane activation for a configurations.void
setArgumentDataEdges
(List<MDataEdge> indataedges) Set the incoming data edges.void
setContextVariableExpression
(String config, jadex.common.UnparsedExpression exp) Set the initialization expression of a declared context variable.void
setFilename
(String filename) Set the filename.void
setKeepAlive
(boolean keepalive) Set the keepalive.void
setLastChecked
(long lastchecked) Set the last checked date.void
setLastModified
(long lastmodified) Set the lastmodified date.void
Set the name of the model.void
setPackage
(String packagename) Set the package name.void
setResultDataEdges
(List<MDataEdge> outdataedges) Set the outgoing data edges.toString()
Get a string representation of this AGR space type.Methods inherited from class jadex.bpmn.model.MAnnotationElement
addAnnotation, getAnnotations
Methods inherited from class jadex.bpmn.model.MIdElement
equals, getId, hashCode, setId
-
Field Details
-
TASK
Constant for task.- See Also:
-
SUBPROCESS
Constant for sub process.- See Also:
-
GATEWAY_PARALLEL
Constant for gateway parallel.- See Also:
-
GATEWAY_DATABASED_EXCLUSIVE
Constant for gateway data based exclusive.- See Also:
-
GATEWAY_DATABASED_INCLUSIVE
Constant for gateway data based exclusive.- See Also:
-
EVENT_START_EMPTY
Constant for event start empty.- See Also:
-
EVENT_START_MESSAGE
Constant for event start message.- See Also:
-
EVENT_START_TIMER
Constant for event start timer.- See Also:
-
EVENT_START_RULE
Constant for event start rule.- See Also:
-
EVENT_START_SIGNAL
Constant for event start signal.- See Also:
-
EVENT_START_MULTIPLE
Constant for event start multiple.- See Also:
-
EVENT_END_EMPTY
Constant for event end empty.- See Also:
-
EVENT_END_ERROR
Constant for event end error.- See Also:
-
EVENT_END_MESSAGE
Constant for event end message.- See Also:
-
EVENT_END_SIGNAL
Constant for event end signal.- See Also:
-
EVENT_END_COMPENSATION
Constant for event end compensation.- See Also:
-
EVENT_END_CANCEL
Constant for event end cancellation.- See Also:
-
EVENT_END_TERMINATE
Constant for event end cancellation.- See Also:
-
EVENT_INTERMEDIATE_EMPTY
Constant for event start empty.- See Also:
-
EVENT_INTERMEDIATE_ERROR
Constant for event intermediate error.- See Also:
-
EVENT_INTERMEDIATE_RULE
Constant for event intermediate rule.- See Also:
-
EVENT_INTERMEDIATE_SIGNAL
Constant for event intermediate signal.- See Also:
-
EVENT_INTERMEDIATE_MESSAGE
Constant for event intermediate message.- See Also:
-
EVENT_INTERMEDIATE_TIMER
Constant for event intermediate timer.- See Also:
-
EVENT_INTERMEDIATE_COMPENSATION
Constant for event intermediate compensation.- See Also:
-
EVENT_INTERMEDIATE_CANCEL
Constant for event intermediate cancellation.- See Also:
-
EVENT_INTERMEDIATE_MULTIPLE
Constant for event intermediate multiple.- See Also:
-
PROPERTY_EVENT_ERROR
Property name for error events.- See Also:
-
PROPERTY_EVENT_RULE_CONDITION
Property name for condition of rule events.- See Also:
-
PROPERTY_EVENT_RULE_EVENTTYPES
Property name for event types of rule events.- See Also:
-
SIGNAL_EVENT_TRIGGER
The signal event handler trigger parameter name. Used to put the trigger in the signal event arguments.- See Also:
-
TRIGGER
The process trigger name. Used to put the trigger event in the process arguments.- See Also:
-
pools
The pools. -
artifacts
The artifacts. -
messages
The messages. -
resultdataedges
The outgoing data edges for results. -
argdataedges
The incoming data edges for arguments. -
alledges
The cached edges of the model. -
allactivities
The cached activities of the model. -
eventsubprocessstartevents
The cached event subprocess start events of the model. -
waitingevents
The cached instance-matched events that require waiting. -
typematchedstartevents
The cached type-matched start events of the model. -
parents
Parents of activities. -
associationsources
The association sources. -
associationtargets
The association targets. -
allmessagingedges
The messaging edges. -
alldataedges
The data edges. -
variables
The context variables (name -> [class, initexpression]). -
configurations
The configurations (config name -> start elements). -
keepalive
protected boolean keepaliveThe keep alive flag that allows processes to stay after end event. -
lastmodified
protected long lastmodifiedThe last modified date. -
lastchecked
protected long lastcheckedThe last check date. -
modelinfo
protected jadex.model.modelinfo.ModelInfo modelinfoThe model info. -
extensions
The extensions.
-
-
Constructor Details
-
MBpmnModel
public MBpmnModel()Create a new model.
-
-
Method Details
-
initModelInfo
Init the model info. -
getPools
Get the pools.- Returns:
- The pools.
-
addPool
Add a pool.- Parameters:
pool
- The pool.
-
removePool
Remove a pool.- Parameters:
pool
- The pool.
-
getPool
Get the pools.- Returns:
- The pools.
-
getArtifacts
Get the artifacts.- Returns:
- The artifacts.
-
addArtifact
Add an artifact.- Parameters:
artifact
- The artifact.
-
removeArtifact
Remove an artifact.- Parameters:
artifact
- The artifact.
-
getMessagingEdges
Get the message edges.- Returns:
- The message edges.
-
addMessagingEdge
Add a message edge.- Parameters:
message
- The message edfe.
-
removeMessagingEdge
Remove a message edge.- Parameters:
message
- The message.
-
getAllEdges
Get all edges.- Returns:
- The edges (id -> edge).
-
getAllDataEdges
Get all data edges.- Returns:
- The data edges (id -> edge).
-
getAllMessagingEdges
Get all message edges.- Returns:
- The message edges (id -> edge).
-
getAllSequenceEdges
Get all sequence edges.- Returns:
- The sequence edges (id -> edge).
-
getAllActivities
Get all activities.- Returns:
- The activities (id -> activity).
-
addAllSubActivities
Add all subactivities. -
getAllEdges
Internal get all edges.- Parameters:
edges
- The edges (results will be added to this).sub
- The subprocess.
-
addEdges
Add edges to the result map.- Parameters:
tmp
- The list of edges.edges
- The result map (id -> edge).
-
getAllAssociationTargets
Get all association targets.- Returns:
- A map of association targets (association id -> target).
-
addActivityTargets
Internal add activity targets.- Parameters:
act
- The activity.
-
addAssociations
protected boolean addAssociations(String assosdesc, MIdElement target, Map<String, MIdElement> targets) Internal add associations.- Parameters:
target
- The target.targets
- The targets result map.
-
getAllAssociationSources
Get all association sources.- Returns:
- The map of association sources (association id -> source).
-
addSubProcesses
Add sub processes.- Parameters:
subproc
- The sub process.sources
- The sources result map.
-
addResultDataEdge
Add an outgoing edge.- Parameters:
edge
- The edge.
-
removeResultDataEdge
Remove an outgoing edge.- Parameters:
edge
- The edge.
-
addArgumentDataEdge
Add an incoming edge.- Parameters:
edge
- The edge.
-
removeArgumentDataEdge
Remove an outgoing edge.- Parameters:
edge
- The edge.
-
getArgumentDataEdges
Get the incoming data edges.- Returns:
- the incoming data edges.
-
setArgumentDataEdges
Set the incoming data edges.- Parameters:
indataedges
- The incoming data edges.
-
getResultDataEdges
Get the outgoing data edges.- Returns:
- the outgoing data edges.
-
setResultDataEdges
Set the outgoing data edges.- Parameters:
outdataedges
- The outgoing data edges.
-
addArtifacts
Add artifacts.- Parameters:
artifacts
- The list of artifacts.sources
- The sources result map (association id -> art).
-
getName
Get the name of the model.- Returns:
- The name of the model.
-
setName
Set the name of the model.- Parameters:
name
- The name to set.
-
getStartActivities
Get all start activities of the model.- Returns:
- A non-empty List of start activities or null, if none.
-
getStartActivities
Get all start activities of the model.- Returns:
- A non-empty List of start activities or null, if none.
-
addStartElement
Add a start element for a configurations.- Parameters:
config
- The configuration name.element
- The start element name.
-
getStartElements
Get the pool lane.- Parameters:
config
- The configurations.
-
removeStartElement
Removes a pool/lane activation for a configurations.- Parameters:
config
- The configuration name.
-
removeConfiguration
Removes a pool/lane activation for a configurations.- Parameters:
config
- The configuration name.
-
addImport
Add an import.- Parameters:
imp
- The import statement.
-
setPackage
Set the package name.- Parameters:
packagename
- The package name to set.
-
toString
Get a string representation of this AGR space type. -
getStartActivities
Get all start activities form the supplied set of activities. Start activities are those without incoming edges.- Returns:
- A non-empty List of start activities or null, if none.
-
addContextVariable
Add a context variable declaration.- Parameters:
variable
- The variable.
-
removeContextVariable
Remove a context variable declaration.- Parameters:
name
- The variable name.
-
removeContextVariable
Remove a context variable declaration.- Parameters:
variable
- The variable.
-
getContextVariables
Get the declared context variables.- Returns:
- A set of variable names.
-
getContextVariable
Get a declared context variable.- Parameters:
name
- The variable name.- Returns:
- The variable.
-
getContextVariableExpression
Get the initialization expression of a declared context variable.- Parameters:
name
- The variable name.- Returns:
- The initialization expression (if any).
-
setContextVariableExpression
Set the initialization expression of a declared context variable.- Parameters:
name
- The variable name.
-
setFilename
Set the filename.- Parameters:
filename
- The filename to set.
-
getLastModified
public long getLastModified()Get the lastmodified date.- Specified by:
getLastModified
in interfacejadex.model.ICacheableModel
- Returns:
- The lastmodified date.
-
setLastModified
public void setLastModified(long lastmodified) Set the lastmodified date.- Parameters:
lastmodified
- The lastmodified date to set.
-
getLastChecked
public long getLastChecked()Get the last checked date.- Specified by:
getLastChecked
in interfacejadex.model.ICacheableModel
- Returns:
- The last checked date
-
setLastChecked
public void setLastChecked(long lastchecked) Set the last checked date.- Specified by:
setLastChecked
in interfacejadex.model.ICacheableModel
- Parameters:
lastchecked
- The last checked date to set.
-
getConfigurations
Get the configurations.- Returns:
- The configuration.
-
getModelInfo
public jadex.model.modelinfo.IModelInfo getModelInfo()Get the model info.- Returns:
- The model info.
-
isKeepAlive
public boolean isKeepAlive()Get the keepalive.- Returns:
- the keepalive.
-
setKeepAlive
public void setKeepAlive(boolean keepalive) Set the keepalive.- Parameters:
keepalive
- The keepalive to set.
-
getFilename
Get the filename.- Specified by:
getFilename
in interfacejadex.model.ICacheableModel
- Returns:
- The filename.
-
getParent
Gets the parent of an element.- Parameters:
element
- The element.- Returns:
- The parent.
-
getTypeMatchedStartEvents
Returns all start events triggered based on type matching.- Returns:
- Events triggered based on type matching.
-
getEventSubProcessStartEvents
Returns all start events in event subprocesses.- Returns:
- Start events in event subprocesses.
-
getEventSubProcessStartEventMapping
Returns a mapping from event subprocesses to their start events.- Returns:
- The mapping
-
getWaitingEvents
Returns all events waiting for outside triggers.- Returns:
- Events waiting for outside triggers.
-
addExtension
-
getExtension
-
initMatchedStartEventCache
protected void initMatchedStartEventCache()Initializes the type and instance event trigger caches. -
cloneElements
public jadex.common.Tuple2<jadex.collection.BiHashMap<String,String>, cloneElementsList<MIdElement>> (Set<MIdElement> originals) Clones a set of elements.- Parameters:
originals
- The original elements.- Returns:
- Mapping of original IDs to cloned IDs, cloned elements.
-
isContainedInParentSet
Checks if an element or one of its parents is in a set.- Parameters:
mmap
- The set.idelem
- The element- Returns:
- True, if contained.
-
getActivityById
Get an activity by id.- Parameters:
id
- The id.- Returns:
- The activity.
-
clearCaches
public void clearCaches()Clears the model caches if stale.
-