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 StringConstant for event end cancellation.static final StringConstant for event end compensation.static final StringConstant for event end empty.static final StringConstant for event end error.static final StringConstant for event end message.static final StringConstant for event end signal.static final StringConstant for event end cancellation.static final StringConstant for event intermediate cancellation.static final StringConstant for event intermediate compensation.static final StringConstant for event start empty.static final StringConstant for event intermediate error.static final StringConstant for event intermediate message.static final StringConstant for event intermediate multiple.static final StringConstant for event intermediate rule.static final StringConstant for event intermediate signal.static final StringConstant for event intermediate timer.static final StringConstant for event start empty.static final StringConstant for event start message.static final StringConstant for event start multiple.static final StringConstant for event start rule.static final StringConstant for event start signal.static final StringConstant for event start timer.protected Map<MSubProcess, List<MActivity>> The cached event subprocess start events of the model.The extensions.static final StringConstant for gateway data based exclusive.static final StringConstant for gateway data based exclusive.static final StringConstant for gateway parallel.protected booleanThe keep alive flag that allows processes to stay after end event.protected longThe last check date.protected longThe last modified date.protected List<MMessagingEdge> The messages.protected jadex.model.modelinfo.ModelInfoThe model info.protected Map<MIdElement, MIdElement> Parents of activities.The pools.static final StringProperty name for error events.static final StringProperty name for condition of rule events.static final StringProperty name for event types of rule events.The outgoing data edges for results.static final StringThe signal event handler trigger parameter name.static final StringConstant for sub process.static final StringConstant for task.static final StringThe 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
annotationsFields inherited from class jadex.bpmn.model.MIdElement
id, ID_GENERATOR -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidInternal add activity targets.voidaddAllSubActivities(MSubProcess proc, Map<String, MActivity> activities) Add all subactivities.voidaddArgumentDataEdge(MDataEdge edge) Add an incoming edge.voidaddArtifact(MArtifact artifact) Add an artifact.protected MArtifactaddArtifacts(List<MArtifact> artifacts, Map<String, MIdElement> sources) Add artifacts.protected booleanaddAssociations(String assosdesc, MIdElement target, Map<String, MIdElement> targets) Internal add associations.voidaddContextVariable(MContextVariable variable) Add a context variable declaration.protected voidaddEdges(List<MSequenceEdge> tmp, Map<String, MSequenceEdge> edges) Add edges to the result map.addExtension(String name, Map<String, Object> ext) voidAdd an import.voidaddMessagingEdge(MMessagingEdge message) Add a message edge.voidAdd a pool.voidaddResultDataEdge(MDataEdge edge) Add an outgoing edge.voidaddStartElement(String config, MNamedIdElement element) Add a start element for a configurations.protected voidaddSubProcesses(MSubProcess subproc, Map<String, MIdElement> sources) Add sub processes.voidClears 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 voidgetAllEdges(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.UnparsedExpressiongetContextVariableExpression(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.longGet the last checked date.longGet the lastmodified date.Get the message edges.jadex.model.modelinfo.IModelInfoGet 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 voidInitializes the type and instance event trigger caches.voidInit the model info.booleanisContainedInParentSet(Set<MIdElement> mmap, MIdElement idelem) Checks if an element or one of its parents is in a set.booleanGet the keepalive.voidRemove an outgoing edge.voidremoveArtifact(MArtifact artifact) Remove an artifact.voidremoveConfiguration(String config) Removes a pool/lane activation for a configurations.voidremoveContextVariable(MContextVariable variable) Remove a context variable declaration.voidremoveContextVariable(String name) Remove a context variable declaration.voidremoveMessagingEdge(MMessagingEdge message) Remove a message edge.voidremovePool(MPool pool) Remove a pool.voidRemove an outgoing edge.voidremoveStartElement(String config, MNamedIdElement element) Removes a pool/lane activation for a configurations.voidsetArgumentDataEdges(List<MDataEdge> indataedges) Set the incoming data edges.voidsetContextVariableExpression(String config, jadex.common.UnparsedExpression exp) Set the initialization expression of a declared context variable.voidsetFilename(String filename) Set the filename.voidsetKeepAlive(boolean keepalive) Set the keepalive.voidsetLastChecked(long lastchecked) Set the last checked date.voidsetLastModified(long lastmodified) Set the lastmodified date.voidSet the name of the model.voidsetPackage(String packagename) Set the package name.voidsetResultDataEdges(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, getAnnotationsMethods 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:
getLastModifiedin 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:
getLastCheckedin interfacejadex.model.ICacheableModel- Returns:
- The last checked date
-
setLastChecked
public void setLastChecked(long lastchecked) Set the last checked date.- Specified by:
setLastCheckedin 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:
getFilenamein 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.
-