Class MBpmnModel

    • Field Detail

      • SUBPROCESS

        public static final java.lang.String SUBPROCESS
        Constant for sub process.
        See Also:
        Constant Field Values
      • GATEWAY_PARALLEL

        public static final java.lang.String GATEWAY_PARALLEL
        Constant for gateway parallel.
        See Also:
        Constant Field Values
      • GATEWAY_DATABASED_EXCLUSIVE

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        public static final java.lang.String PROPERTY_EVENT_ERROR
        Property name for error events.
        See Also:
        Constant Field Values
      • PROPERTY_EVENT_RULE_CONDITION

        public static final java.lang.String PROPERTY_EVENT_RULE_CONDITION
        Property name for condition of rule events.
        See Also:
        Constant Field Values
      • PROPERTY_EVENT_RULE_EVENTTYPES

        public static final java.lang.String PROPERTY_EVENT_RULE_EVENTTYPES
        Property name for event types of rule events.
        See Also:
        Constant Field Values
      • SIGNAL_EVENT_TRIGGER

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

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

        protected java.util.List<MPool> pools
        The pools.
      • artifacts

        protected java.util.List<MArtifact> artifacts
        The artifacts.
      • messages

        protected java.util.List<MMessagingEdge> messages
        The messages.
      • resultdataedges

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

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

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

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

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

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

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

        protected java.util.Map<java.lang.String,​MIdElement> associationsources
        The association sources.
      • associationtargets

        protected java.util.Map<java.lang.String,​MIdElement> associationtargets
        The association targets.
      • allmessagingedges

        protected java.util.Map<java.lang.String,​MMessagingEdge> allmessagingedges
        The messaging edges.
      • alldataedges

        protected java.util.Map<java.lang.String,​MDataEdge> alldataedges
        The data edges.
      • variables

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

        protected java.util.Map<java.lang.String,​java.util.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 ModelInfo modelinfo
        The model info.
    • Constructor Detail

      • MBpmnModel

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

      • initModelInfo

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

        public java.util.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​(java.lang.String name)
        Get the pools.
        Returns:
        The pools.
      • getArtifacts

        public java.util.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 java.util.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 java.util.Map<java.lang.String,​MEdge> getAllEdges()
        Get all edges.
        Returns:
        The edges (id -> edge).
      • getAllDataEdges

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

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

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

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

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

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

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

        public java.util.Map<java.lang.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​(java.lang.String assosdesc,
                                          MIdElement target,
                                          java.util.Map<java.lang.String,​MIdElement> targets)
        Internal add associations.
        Parameters:
        target - The target.
        targets - The targets result map.
      • getAllAssociationSources

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

        protected void addSubProcesses​(MSubProcess subproc,
                                       java.util.Map<java.lang.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 java.util.List<MDataEdge> getArgumentDataEdges()
        Get the incoming data edges.
        Returns:
        the incoming data edges.
      • setArgumentDataEdges

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

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

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

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

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

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

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

        public java.util.List<MActivity> getStartActivities​(java.lang.String poolname,
                                                            java.lang.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​(java.lang.String config,
                                    MNamedIdElement element)
        Add a start element for a configurations.
        Parameters:
        config - The configuration name.
        element - The start element name.
      • getStartElements

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

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

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

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

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

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

        public static java.util.List<MActivity> getStartActivities​(java.util.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​(java.lang.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 java.util.List<MContextVariable> getContextVariables()
        Get the declared context variables.
        Returns:
        A set of variable names.
      • getContextVariable

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

        public UnparsedExpression getContextVariableExpression​(java.lang.String name,
                                                               java.lang.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​(java.lang.String config,
                                                 UnparsedExpression exp)
        Set the initialization expression of a declared context variable.
        Parameters:
        name - The variable name.
      • setFilename

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

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

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

        protected java.lang.String[] getConfigurations()
        Get the configurations.
        Returns:
        The configuration.
      • addArgument

        public void addArgument​(IArgument argument)
        Add an argument.
        Parameters:
        argument - The argument.
      • addProperty

        public void addProperty​(java.lang.String name,
                                java.lang.Object value)
        Add a property.
      • addResult

        public void addResult​(IArgument result)
        Add a result.
        Parameters:
        result - The result.
      • getModelInfo

        public 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.
      • getClassLoader

        public java.lang.ClassLoader getClassLoader()
        Get the classloader.
        Returns:
        the classloader.
      • setClassLoader

        public void setClassLoader​(java.lang.ClassLoader classloader)
        Set the classloader.
        Parameters:
        classloader - The classloader to set.
      • setResourceIdentifier

        public void setResourceIdentifier​(IResourceIdentifier rid)
        Set the resource identifier.
        Parameters:
        rid - The resource identifier.
      • getResourceIdentifier

        public IResourceIdentifier getResourceIdentifier()
        Get the resource identifier.
        Returns:
        The resource identifier.
      • getFilename

        public java.lang.String getFilename()
        Get the filename.
        Specified by:
        getFilename in interface 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 java.util.List<MActivity> getTypeMatchedStartEvents()
        Returns all start events triggered based on type matching.
        Returns:
        Events triggered based on type matching.
      • getEventSubProcessStartEvents

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

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

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

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

        public Tuple2<BiHashMap<java.lang.String,​java.lang.String>,​java.util.List<MIdElement>> cloneElements​(java.util.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​(java.util.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​(java.lang.String id)
        Get an activity by id.
        Parameters:
        id - The id.
        Returns:
        The activity.
      • clearCaches

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