Class MBpmnModel

All Implemented Interfaces:
jadex.model.ICacheableModel

public class MBpmnModel extends MAnnotationElement implements jadex.model.ICacheableModel
Java representation of a bpmn model for xml description.
  • Field Details

    • TASK

      public static final String TASK
      Constant for task.
      See Also:
    • SUBPROCESS

      public static final String SUBPROCESS
      Constant for sub process.
      See Also:
    • GATEWAY_PARALLEL

      public static final String GATEWAY_PARALLEL
      Constant for gateway parallel.
      See Also:
    • GATEWAY_DATABASED_EXCLUSIVE

      public static final String GATEWAY_DATABASED_EXCLUSIVE
      Constant for gateway data based exclusive.
      See Also:
    • GATEWAY_DATABASED_INCLUSIVE

      public static final String GATEWAY_DATABASED_INCLUSIVE
      Constant for gateway data based exclusive.
      See Also:
    • EVENT_START_EMPTY

      public static final String EVENT_START_EMPTY
      Constant for event start empty.
      See Also:
    • EVENT_START_MESSAGE

      public static final String EVENT_START_MESSAGE
      Constant for event start message.
      See Also:
    • EVENT_START_TIMER

      public static final String EVENT_START_TIMER
      Constant for event start timer.
      See Also:
    • EVENT_START_RULE

      public static final String EVENT_START_RULE
      Constant for event start rule.
      See Also:
    • EVENT_START_SIGNAL

      public static final String EVENT_START_SIGNAL
      Constant for event start signal.
      See Also:
    • EVENT_START_MULTIPLE

      public static final String EVENT_START_MULTIPLE
      Constant for event start multiple.
      See Also:
    • EVENT_END_EMPTY

      public static final String EVENT_END_EMPTY
      Constant for event end empty.
      See Also:
    • EVENT_END_ERROR

      public static final String EVENT_END_ERROR
      Constant for event end error.
      See Also:
    • EVENT_END_MESSAGE

      public static final String EVENT_END_MESSAGE
      Constant for event end message.
      See Also:
    • EVENT_END_SIGNAL

      public static final String EVENT_END_SIGNAL
      Constant for event end signal.
      See Also:
    • EVENT_END_COMPENSATION

      public static final String EVENT_END_COMPENSATION
      Constant for event end compensation.
      See Also:
    • EVENT_END_CANCEL

      public static final String EVENT_END_CANCEL
      Constant for event end cancellation.
      See Also:
    • EVENT_END_TERMINATE

      public static final String EVENT_END_TERMINATE
      Constant for event end cancellation.
      See Also:
    • EVENT_INTERMEDIATE_EMPTY

      public static final String EVENT_INTERMEDIATE_EMPTY
      Constant for event start empty.
      See Also:
    • EVENT_INTERMEDIATE_ERROR

      public static final String EVENT_INTERMEDIATE_ERROR
      Constant for event intermediate error.
      See Also:
    • EVENT_INTERMEDIATE_RULE

      public static final String EVENT_INTERMEDIATE_RULE
      Constant for event intermediate rule.
      See Also:
    • EVENT_INTERMEDIATE_SIGNAL

      public static final String EVENT_INTERMEDIATE_SIGNAL
      Constant for event intermediate signal.
      See Also:
    • EVENT_INTERMEDIATE_MESSAGE

      public static final String EVENT_INTERMEDIATE_MESSAGE
      Constant for event intermediate message.
      See Also:
    • EVENT_INTERMEDIATE_TIMER

      public static final String EVENT_INTERMEDIATE_TIMER
      Constant for event intermediate timer.
      See Also:
    • EVENT_INTERMEDIATE_COMPENSATION

      public static final String EVENT_INTERMEDIATE_COMPENSATION
      Constant for event intermediate compensation.
      See Also:
    • EVENT_INTERMEDIATE_CANCEL

      public static final String EVENT_INTERMEDIATE_CANCEL
      Constant for event intermediate cancellation.
      See Also:
    • EVENT_INTERMEDIATE_MULTIPLE

      public static final String EVENT_INTERMEDIATE_MULTIPLE
      Constant for event intermediate multiple.
      See Also:
    • PROPERTY_EVENT_ERROR

      public static final String PROPERTY_EVENT_ERROR
      Property name for error events.
      See Also:
    • PROPERTY_EVENT_RULE_CONDITION

      public static final String PROPERTY_EVENT_RULE_CONDITION
      Property name for condition of rule events.
      See Also:
    • PROPERTY_EVENT_RULE_EVENTTYPES

      public static final String PROPERTY_EVENT_RULE_EVENTTYPES
      Property name for event types of rule events.
      See Also:
    • SIGNAL_EVENT_TRIGGER

      public static final String SIGNAL_EVENT_TRIGGER
      The signal event handler trigger parameter name. Used to put the trigger in the signal event arguments.
      See Also:
    • TRIGGER

      public static final String TRIGGER
      The process trigger name. Used to put the trigger event in the process arguments.
      See Also:
    • pools

      protected List<MPool> pools
      The pools.
    • artifacts

      protected List<MArtifact> artifacts
      The artifacts.
    • messages

      protected List<MMessagingEdge> messages
      The messages.
    • resultdataedges

      protected List<MDataEdge> resultdataedges
      The outgoing data edges for results.
    • argdataedges

      protected List<MDataEdge> argdataedges
      The incoming data edges for arguments.
    • alledges

      protected Map<String,MSequenceEdge> alledges
      The cached edges of the model.
    • allactivities

      protected Map<String,MActivity> allactivities
      The cached activities of the model.
    • eventsubprocessstartevents

      protected Map<MSubProcess,List<MActivity>> eventsubprocessstartevents
      The cached event subprocess start events of the model.
    • waitingevents

      protected List<MActivity> waitingevents
      The cached instance-matched events that require waiting.
    • typematchedstartevents

      protected List<MActivity> typematchedstartevents
      The cached type-matched start events of the model.
    • parents

      protected Map<MIdElement,MIdElement> parents
      Parents of activities.
    • associationsources

      protected Map<String,MIdElement> associationsources
      The association sources.
    • associationtargets

      protected Map<String,MIdElement> associationtargets
      The association targets.
    • allmessagingedges

      protected Map<String,MMessagingEdge> allmessagingedges
      The messaging edges.
    • alldataedges

      protected Map<String,MDataEdge> alldataedges
      The data edges.
    • variables

      protected Map<String,MContextVariable> variables
      The context variables (name -> [class, initexpression]).
    • configurations

      protected Map<String,List<MNamedIdElement>> configurations
      The configurations (config name -> start elements).
    • keepalive

      protected boolean keepalive
      The keep alive flag that allows processes to stay after end event.
    • lastmodified

      protected long lastmodified
      The last modified date.
    • lastchecked

      protected long lastchecked
      The last check date.
    • modelinfo

      protected jadex.model.modelinfo.ModelInfo modelinfo
      The model info.
    • extensions

      protected Map<String,Map<String,Object>> extensions
      The extensions.
  • Constructor Details

    • MBpmnModel

      public MBpmnModel()
      Create a new model.
  • Method Details

    • initModelInfo

      public void initModelInfo(ClassLoader cl)
      Init the model info.
    • getPools

      public List<MPool> getPools()
      Get the pools.
      Returns:
      The pools.
    • addPool

      public void addPool(MPool pool)
      Add a pool.
      Parameters:
      pool - The pool.
    • removePool

      public void removePool(MPool pool)
      Remove a pool.
      Parameters:
      pool - The pool.
    • getPool

      public MPool getPool(String name)
      Get the pools.
      Returns:
      The pools.
    • getArtifacts

      public List<MArtifact> getArtifacts()
      Get the artifacts.
      Returns:
      The artifacts.
    • addArtifact

      public void addArtifact(MArtifact artifact)
      Add an artifact.
      Parameters:
      artifact - The artifact.
    • removeArtifact

      public void removeArtifact(MArtifact artifact)
      Remove an artifact.
      Parameters:
      artifact - The artifact.
    • getMessagingEdges

      public List<MMessagingEdge> getMessagingEdges()
      Get the message edges.
      Returns:
      The message edges.
    • addMessagingEdge

      public void addMessagingEdge(MMessagingEdge message)
      Add a message edge.
      Parameters:
      message - The message edfe.
    • removeMessagingEdge

      public void removeMessagingEdge(MMessagingEdge message)
      Remove a message edge.
      Parameters:
      message - The message.
    • getAllEdges

      public Map<String,MEdge> getAllEdges()
      Get all edges.
      Returns:
      The edges (id -> edge).
    • getAllDataEdges

      public Map<String,MDataEdge> getAllDataEdges()
      Get all data edges.
      Returns:
      The data edges (id -> edge).
    • getAllMessagingEdges

      public Map<String,MMessagingEdge> getAllMessagingEdges()
      Get all message edges.
      Returns:
      The message edges (id -> edge).
    • getAllSequenceEdges

      public Map<String,MSequenceEdge> getAllSequenceEdges()
      Get all sequence edges.
      Returns:
      The sequence edges (id -> edge).
    • getAllActivities

      public Map<String,MActivity> getAllActivities()
      Get all activities.
      Returns:
      The activities (id -> activity).
    • addAllSubActivities

      public void addAllSubActivities(MSubProcess proc, Map<String,MActivity> activities)
      Add all subactivities.
    • getAllEdges

      protected void getAllEdges(MActivity act, Map<String,MSequenceEdge> edges)
      Internal get all edges.
      Parameters:
      edges - The edges (results will be added to this).
      sub - The subprocess.
    • addEdges

      protected void addEdges(List<MSequenceEdge> tmp, Map<String,MSequenceEdge> edges)
      Add edges to the result map.
      Parameters:
      tmp - The list of edges.
      edges - The result map (id -> edge).
    • getAllAssociationTargets

      public Map<String,MIdElement> getAllAssociationTargets()
      Get all association targets.
      Returns:
      A map of association targets (association id -> target).
    • addActivityTargets

      protected void addActivityTargets(MActivity act)
      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

      public Map<String,MIdElement> getAllAssociationSources()
      Get all association sources.
      Returns:
      The map of association sources (association id -> source).
    • addSubProcesses

      protected void addSubProcesses(MSubProcess subproc, Map<String,MIdElement> sources)
      Add sub processes.
      Parameters:
      subproc - The sub process.
      sources - The sources result map.
    • addResultDataEdge

      public void addResultDataEdge(MDataEdge edge)
      Add an outgoing edge.
      Parameters:
      edge - The edge.
    • removeResultDataEdge

      public void removeResultDataEdge(MDataEdge edge)
      Remove an outgoing edge.
      Parameters:
      edge - The edge.
    • addArgumentDataEdge

      public void addArgumentDataEdge(MDataEdge edge)
      Add an incoming edge.
      Parameters:
      edge - The edge.
    • removeArgumentDataEdge

      public void removeArgumentDataEdge(MDataEdge edge)
      Remove an outgoing edge.
      Parameters:
      edge - The edge.
    • getArgumentDataEdges

      public List<MDataEdge> getArgumentDataEdges()
      Get the incoming data edges.
      Returns:
      the incoming data edges.
    • setArgumentDataEdges

      public void setArgumentDataEdges(List<MDataEdge> indataedges)
      Set the incoming data edges.
      Parameters:
      indataedges - The incoming data edges.
    • getResultDataEdges

      public List<MDataEdge> getResultDataEdges()
      Get the outgoing data edges.
      Returns:
      the outgoing data edges.
    • setResultDataEdges

      public void setResultDataEdges(List<MDataEdge> outdataedges)
      Set the outgoing data edges.
      Parameters:
      outdataedges - The outgoing data edges.
    • addArtifacts

      protected MArtifact addArtifacts(List<MArtifact> artifacts, Map<String,MIdElement> sources)
      Add artifacts.
      Parameters:
      artifacts - The list of artifacts.
      sources - The sources result map (association id -> art).
    • getName

      public String getName()
      Get the name of the model.
      Returns:
      The name of the model.
    • setName

      public void setName(String name)
      Set the name of the model.
      Parameters:
      name - The name to set.
    • getStartActivities

      public List<MActivity> getStartActivities()
      Get all start activities of the model.
      Returns:
      A non-empty List of start activities or null, if none.
    • getStartActivities

      public List<MActivity> getStartActivities(String poolname, String lanename)
      Get all start activities of the model.
      Returns:
      A non-empty List of start activities or null, if none.
    • addStartElement

      public void addStartElement(String config, MNamedIdElement element)
      Add a start element for a configurations.
      Parameters:
      config - The configuration name.
      element - The start element name.
    • getStartElements

      public List<MNamedIdElement> getStartElements(String config)
      Get the pool lane.
      Parameters:
      config - The configurations.
    • removeStartElement

      public void removeStartElement(String config, MNamedIdElement element)
      Removes a pool/lane activation for a configurations.
      Parameters:
      config - The configuration name.
    • removeConfiguration

      public void removeConfiguration(String config)
      Removes a pool/lane activation for a configurations.
      Parameters:
      config - The configuration name.
    • addImport

      public void addImport(String imp)
      Add an import.
      Parameters:
      imp - The import statement.
    • setPackage

      public void setPackage(String packagename)
      Set the package name.
      Parameters:
      packagename - The package name to set.
    • toString

      public String toString()
      Get a string representation of this AGR space type.
      Overrides:
      toString in class Object
      Returns:
      A string representation of this AGR space type.
    • getStartActivities

      public static List<MActivity> getStartActivities(List<MActivity> activities)
      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

      public void addContextVariable(MContextVariable variable)
      Add a context variable declaration.
      Parameters:
      variable - The variable.
    • removeContextVariable

      public void removeContextVariable(String name)
      Remove a context variable declaration.
      Parameters:
      name - The variable name.
    • removeContextVariable

      public void removeContextVariable(MContextVariable variable)
      Remove a context variable declaration.
      Parameters:
      variable - The variable.
    • getContextVariables

      public List<MContextVariable> getContextVariables()
      Get the declared context variables.
      Returns:
      A set of variable names.
    • getContextVariable

      public MContextVariable getContextVariable(String name)
      Get a declared context variable.
      Parameters:
      name - The variable name.
      Returns:
      The variable.
    • getContextVariableExpression

      public jadex.common.UnparsedExpression getContextVariableExpression(String name, String config)
      Get the initialization expression of a declared context variable.
      Parameters:
      name - The variable name.
      Returns:
      The initialization expression (if any).
    • setContextVariableExpression

      public void setContextVariableExpression(String config, jadex.common.UnparsedExpression exp)
      Set the initialization expression of a declared context variable.
      Parameters:
      name - The variable name.
    • setFilename

      public void setFilename(String filename)
      Set the filename.
      Parameters:
      filename - The filename to set.
    • getLastModified

      public long getLastModified()
      Get the lastmodified date.
      Specified by:
      getLastModified in interface jadex.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 interface jadex.model.ICacheableModel
      Returns:
      The last checked date
    • setLastChecked

      public void setLastChecked(long lastchecked)
      Set the last checked date.
      Specified by:
      setLastChecked in interface jadex.model.ICacheableModel
      Parameters:
      lastchecked - The last checked date to set.
    • getConfigurations

      protected String[] 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

      public String getFilename()
      Get the filename.
      Specified by:
      getFilename in interface jadex.model.ICacheableModel
      Returns:
      The filename.
    • getParent

      public MIdElement getParent(MIdElement element)
      Gets the parent of an element.
      Parameters:
      element - The element.
      Returns:
      The parent.
    • getTypeMatchedStartEvents

      public List<MActivity> getTypeMatchedStartEvents()
      Returns all start events triggered based on type matching.
      Returns:
      Events triggered based on type matching.
    • getEventSubProcessStartEvents

      public List<MActivity> getEventSubProcessStartEvents()
      Returns all start events in event subprocesses.
      Returns:
      Start events in event subprocesses.
    • getEventSubProcessStartEventMapping

      public Map<MSubProcess,List<MActivity>> getEventSubProcessStartEventMapping()
      Returns a mapping from event subprocesses to their start events.
      Returns:
      The mapping
    • getWaitingEvents

      public List<MActivity> getWaitingEvents()
      Returns all events waiting for outside triggers.
      Returns:
      Events waiting for outside triggers.
    • addExtension

      public MBpmnModel addExtension(String name, Map<String,Object> ext)
    • getExtension

      public Map<String,Object> getExtension(String name)
    • initMatchedStartEventCache

      protected void initMatchedStartEventCache()
      Initializes the type and instance event trigger caches.
    • cloneElements

      public jadex.common.Tuple2<jadex.collection.BiHashMap<String,String>,List<MIdElement>> cloneElements(Set<MIdElement> originals)
      Clones a set of elements.
      Parameters:
      originals - The original elements.
      Returns:
      Mapping of original IDs to cloned IDs, cloned elements.
    • isContainedInParentSet

      public boolean isContainedInParentSet(Set<MIdElement> mmap, MIdElement idelem)
      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

      public MActivity getActivityById(String id)
      Get an activity by id.
      Parameters:
      id - The id.
      Returns:
      The activity.
    • clearCaches

      public void clearCaches()
      Clears the model caches if stale.