Interface MTModelHeader

All Superinterfaces:
Comparable<MTNamedObject>, MTDataObject, MTNamedObject
All Known Subinterfaces:
MTCompleteModel, MTCompleteSwimlaneModel, MTModel, MTSwimlaneModel

public interface MTModelHeader extends MTDataObject
Header interface for models. A model is the visual representation of for example a business process or an organizational structure. It consists of a collection of vertices and a collection of edges interconnecting these vertices.
Since:
3.0
  • Field Details

    • LOCK_TIME_PERIOD

      static final int LOCK_TIME_PERIOD
      Number of seconds a lock will be in effect from the time of invocation of a locking method (lock()). This may change between versions of this package.
      See Also:
  • Method Details

    • getRepositoryID

      long getRepositoryID()
      Returns the ID of the repository that this model belongs to.
      Returns:
      the ID of the repository that this model belongs to.
    • getWorkspaceID

      long getWorkspaceID()
      Returns the ID of the workspace of this model.
      Returns:
      the ID of the workspace of this model.
    • getType

      ModelType getType()
      Returns this models ModelType, or null if no suitable type is found.
      Specified by:
      getType in interface MTDataObject
      Returns:
      this models ModelType, or null if no suitable type is found.
    • getGroupTitle

      String getGroupTitle()
      Returns the name of the group.
      Returns:
      The group name
      Since:
      3.1
    • getRevision

      MTRevisionInfo getRevision()
      Returns the models revision info.
      Returns:
      The models revision info.
      Since:
      4.3
    • getWorkflowState

      WorkflowState getWorkflowState()
      Returns the current workflow state.
      Returns:
      The workflow state of the model.
    • isNotify

      boolean isNotify()
      Checks whether notifications should be sent in next publication.
      Returns:
      True if notifications should be sent, false otherwise.
    • expand

      MTModel expand() throws MTAccessException
      Returns a MTModel for this model. Beware that this might require querying the storage layer for more data.
      Returns:
      A MTModel representing this model.
      Throws:
      MTAccessException - If an MTAccessException occurs.
      Since:
      3.0
    • remove

      boolean remove() throws MTAccessException, MTRemoteChangeException
      Removes the model. Only this revision of the model will be removed and it will only be removed from the current workspace since it can exist in other workspaces if it is a locked revision. The symbols in the model will not be removed since they may be used elsewhere.
      Returns:
      a boolean.
      Throws:
      MTAccessException - If an MTAccessException occurs.
      MTRemoteChangeException - If an MTRemoteChangeException occurs.
      Since:
      3.0
    • load

      Loads the complete model with all vertices, edges and symbols.
      Returns:
      The complete loaded model.
      Throws:
      MTAccessException - If an MTAccessException occurs.
      Since:
      3.0
    • lock

      Tries to aquire a temporary lock on this model. If aquired, the method returns normally, otherwise an MTRemoteChangeException is raised. An aquired lock will prevent other users from making changes to this model and in effect ensures that no MTRemoteChangeException occur on other calls while the lock is in effect. The lock will be in effect for at least LOCK_TIME_PERIOD seconds from the time of the call. If save is invoked and successfull within that time, the lock is automatically prolonged.

      NOTE:
      • This method may block for an unspecified amount of time.
      • Callers can not assume to have the lock for the specified time as counted from the return from this method, but from the invocation of this method!
      Throws:
      MTAccessException - if the current user lack access rights to this object.
      MTRemoteChangeException - if this model has changed since it was last fetched from storage or if someone else (other MTUser) currently holds the lock.
    • lock

      void lock(long duration) throws MTAccessException, MTRemoteChangeException
      Tries to lock the model for a given duration in milliseconds.
      Parameters:
      duration - The duration
      Throws:
      MTAccessException - if the current user lack access rights to this object.
      MTRemoteChangeException - if this model has changed since it was last fetched from storage or if someone else (other MTUser) currently holds the lock.
      See Also:
    • releaseLock

      void releaseLock()
      Immediately releases a lock on the model. If this method is not called the lock will be released when 5 minutes has passed from when it was required. If another user has the lock this method will have no effect.
    • findAttributes

      List<MTAttribute> findAttributes() throws MTAccessException
      Finds the models attributes.
      Returns:
      The attributes for the model.
      Throws:
      MTAccessException - If an MTAccessException occurs.
      Since:
      5.0
    • findAttributeByType

      MTAttribute findAttributeByType(String typeUUID) throws MTAccessException
      Finds a attribute for this model, based on its type UUID.
      Returns:
      the attribute for this model where the attribute has an attribute type with UUID 'uuid'.
      Throws:
      MTAccessException - If an MTAccessException occurs.
      Since:
      5.0
    • findAttributeHeaders

      List<MTAttributeHeader> findAttributeHeaders() throws MTAccessException
      Finds the models attributes as headers.
      Returns:
      The attributes for the model.
      Throws:
      MTAccessException - If an MTAccessException occurs.
      Since:
      5.0
    • findDocumentIDs

      List<Long> findDocumentIDs() throws MTAccessException
      Finds the ID:s of documents connected to this model.
      Returns:
      The ID:s of documents connected to this model.
      Throws:
      MTAccessException - If an MTAccessException occurs.
      Since:
      3.0
    • findDocuments

      MTIterator<MTDocument> findDocuments() throws MTAccessException
      Finds the documents connected to this model.
      Returns:
      An iterator over all documents connected to this model.
      Throws:
      MTAccessException - If an MTAccessException occurs.
      Since:
      3.0
    • findDocumentHeaders

      MTIterator<MTDocumentHeader> findDocumentHeaders() throws MTAccessException
      Finds the documents connected to this model as headers.
      Returns:
      An iterator over all documents connected to this model.
      Throws:
      MTAccessException - If an MTAccessException occurs.
      Since:
      3.0
    • findExtensionDocuments

      List<MTExtensionDocument> findExtensionDocuments(String provider) throws MTAccessException
      Finds the extension documents connected to this model.
      Parameters:
      provider - The provider to get documents for.
      Returns:
      All extenstion documents connected to this model.
      Throws:
      MTAccessException - If an MTAccessException occurs.
      Since:
      3.0
    • findVertices

      List<MTVertex> findVertices() throws MTAccessException
      Finds all vertices in this model.
      Returns:
      All vertices in the model.
      Throws:
      MTAccessException - If an MTAccessException occurs.
      Since:
      3.0
    • findVertexHeaders

      List<MTVertexHeader> findVertexHeaders() throws MTAccessException
      Finds all vertices in this model as headers.
      Returns:
      All vertices in the model.
      Throws:
      MTAccessException - If an MTAccessException occurs.
      Since:
      3.0
    • findSymbols

      List<MTSymbol> findSymbols() throws MTAccessException
      Finds all symbols in this model.
      Returns:
      All symbols in the model.
      Throws:
      MTAccessException - If an MTAccessException occurs.
      Since:
      3.0
    • findSymbolHeaders

      List<MTSymbolHeader> findSymbolHeaders() throws MTAccessException
      Finds all symbols in this model as headers.
      Returns:
      All symbols in the model.
      Throws:
      MTAccessException - If an MTAccessException occurs.
      Since:
      3.0
    • findEdges

      List<MTEdge> findEdges() throws MTAccessException
      Finds all edges in this model.
      Returns:
      All edges in the model.
      Throws:
      MTAccessException - If an MTAccessException occurs.
      Since:
      3.0
    • findEdge

      MTEdge findEdge(String typeUUID) throws MTAccessException
      Finds an edge in this model, based on its type UUID.
      Returns:
      edge in this model with UUID 'uuid'.
      Throws:
      MTAccessException - If an MTAccessException occurs.
      Since:
      3.1
    • findEdgeHeaders

      List<MTEdgeHeader> findEdgeHeaders() throws MTAccessException
      Finds all edges in this model as headers.
      Returns:
      All edges in the model.
      Throws:
      MTAccessException - If an MTAccessException occurs.
      Since:
      3.0
    • findLayers

      List<MTLayer> findLayers() throws MTAccessException
      Finds all layers in this model.
      Returns:
      All layers in the model.
      Throws:
      MTAccessException - If an MTAccessException occurs.
      Since:
      3.0
    • findLayerHeaders

      List<MTLayerHeader> findLayerHeaders() throws MTAccessException
      Finds all layers in this model as headers.
      Returns:
      All layers in the model.
      Throws:
      MTAccessException - If an MTAccessException occurs.
      Since:
      3.0
    • createPluginData

      MTPluginData createPluginData(MTDataProvider provider, String key)
      Creates a new plug-in data connected to this model.
      Parameters:
      provider - The provider.
      key - The key to store the data under.
      Returns:
      A new plug-in data.
      Since:
      3.1
    • findPluginData

      Collection<MTPluginData> findPluginData(MTDataProvider provider, String key) throws MTAccessException
      Finds plug-in data connected to this model.
      Parameters:
      provider - The provider to find data for.
      key - The key for the data to find. If null all data for the provider will be returned.
      Returns:
      The resulting plug-in data
      Throws:
      MTAccessException
      Since:
      3.3
    • findBreakdowns

      Collection<MTModelHeader> findBreakdowns() throws MTAccessException
      Finds all breakdowns, in the current workspace, for this MTModelHeader.
      Returns:
      all breakdowns, in the current workspace, for this MTModelHeader.
      Throws:
      MTAccessException - if the user don't have the proper access rights.
    • findRevisions

      List<MTRevisionInfo> findRevisions()
      Finds information about the revisions available of this model.
      Returns:
      A list of information about the different revisions made of this model.
      Since:
      3.3
    • getPluginDataBulkOperations

      MTPluginDataOperations getPluginDataBulkOperations()
    • getNewPluginData

      List<MTPluginDataOperations.Data> getNewPluginData()
    • setNewPluginData

      void setNewPluginData(List<MTPluginDataOperations.Data> data)
    • getNewPluginRelations

      List<MTPluginDataOperations.Relation> getNewPluginRelations()
    • setNewPluginRelations

      void setNewPluginRelations(List<MTPluginDataOperations.Relation> relations)
    • restore

      default Long restore()
      If this model has previously been removed from the current workspace it will be restored. Any symbols used in the restored model will be synchronized to use the current versions in the current workspace. If needed a new revision of the model will be created to make these changes.
      Returns:
      The id of the restored model or null if the model could not be restored. This can be the ID of this model or a new revision if it was needed to keep symbols in the model up-to-date.