Package se.conciliate.extensions.store
Interface MTModel
- All Superinterfaces:
Comparable<MTNamedObject>
,MTDataObject
,MTHistoryEnabled
,MTModelHeader
,MTNamedObject
- All Known Subinterfaces:
MTCompleteModel
,MTCompleteSwimlaneModel
,MTSwimlaneModel
Full 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 Summary
Fields inherited from interface se.conciliate.extensions.store.MTModelHeader
LOCK_TIME_PERIOD
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addDocument
(MTDocumentHeader document) Adds a document to the model.void
addToRemovalHistory
(String removedEntityUUID, String historyPath) Adds to the models entries for removed entities (vertices and edges).boolean
boolean
Prepares for a change to the current revision of the model, i.e.default void
connectDocument
(Document document) Connects a document to a model.default void
Connects a document to a model.Prepares for creating a new revision of the model.default void
disconnectDocument
(Document document) Disconnects a document from the model.default void
Disconnects a document from the model.Returns the users that have permission to approve this model.Returns the attribute of the given type.getAttributes
(Predicate<MTAttribute> predicate) Returns the attributes connected to the model as a read-only list.getGroup()
Returns the "access control" group of this object.Returns the user that last modified this object.Returns the users that have permission to maintain this model.getOwner()
Returns "access control" owner of this object.Returns "access control" permissions for this object.getProperty
(String provider, String name) Returns a property value.getPropertyKeys
(String provider) Returns the property names of all properties stored by a provider.Returns all providers that have stored properties.Returns the "history" of removals made in this model.Returns the users that have permission to review this model.Returns the revision log for this revision of the model.Returns the subscribers of this model.boolean
Returns true if there is plug-in data connected to the entity.Prepares for locking the current revision of the model.void
removeDocument
(MTDocumentHeader document) Removes a document from the model.void
removeProperty
(String provider, String name) Removes a property.Prepares for reverting to an earlier revision of the model.void
save()
Saves changes made to the model.void
setApprovers
(Set<MTUserHeader> users) Deprecated.This has been replaced by MTModelStore.setApprovers which can update approvers on locked revisions of models.void
setCreated
(Date date) Sets the creation date for the model.void
setCreatedBy
(MTUserHeader user) void
setGroup
(MTPermissionGroup group) Set the "access control" group of this object.void
setLastModified
(Date date) Sets the last modified date for the model.void
Set the last user that modified this object.void
setMaintainers
(Set<MTUserHeader> users) Deprecated.This has been replaced by MTModelStore.setMaintainers which can update maintainers on locked revisions of models.void
setNotify
(boolean notify) Sets whether notifications should be sent in next publication.void
setOwner
(MTUserHeader owner) Sets "access control" owner of this object.void
setPermissions
(int permissions) void
setPermissions
(MTPermissions permissions) Sets "access control" permissions for this object.void
Sets a prefix used to identify this model.void
setPrefixLocked
(boolean locked) Locks the current prefix so it cannot be modified.void
setProperty
(String provider, String name, String value) Sets a property value.void
setReferenceID
(String referenceID) Sets the reference ID of the model.void
setReviewers
(Set<MTUserHeader> users) Deprecated.This has been replaced by MTModelStore.setReviewers which can update reviewers on locked revisions of models.void
setSubscribers
(Set<MTSubscriber> subscribers) Deprecated.This has been replaced by MTModelStore.setSubscribers which can update subscribers on locked revisions of models.void
Sets the title of the model in the current language.void
setTitle
(MTLanguageHeader language, String title) Sets the title of the model in a given language.void
setTranslated
(MTLanguage lang, boolean translated) Marks this symbol as translated in the given language.void
Sets the type of the model.void
setWorkflowState
(WorkflowState state) Sets the current workflow state.Methods inherited from interface se.conciliate.extensions.store.MTDataObject
getCreated, getLastModified, getLastModifiedByName, getOwnerName, getPrefix, getReferenceID, getTypeID, isPrefixLocked, isRevisionLocked, isTranslated, isTranslated
Methods inherited from interface se.conciliate.extensions.store.MTHistoryEnabled
getHistory, getID, getUUID
Methods inherited from interface se.conciliate.extensions.store.MTModelHeader
createPluginData, expand, findAttributeByType, findAttributeHeaders, findAttributes, findBreakdowns, findDocumentHeaders, findDocumentIDs, findDocuments, findEdge, findEdgeHeaders, findEdges, findExtensionDocuments, findLayerHeaders, findLayers, findPluginData, findRevisions, findSymbolHeaders, findSymbols, findVertexHeaders, findVertices, getGroupTitle, getNewPluginData, getNewPluginRelations, getPluginDataBulkOperations, getRepositoryID, getRevision, getType, getWorkflowState, getWorkspaceID, isNotify, load, lock, lock, releaseLock, remove, restore, setNewPluginData, setNewPluginRelations
Methods inherited from interface se.conciliate.extensions.store.MTNamedObject
compareTo, getID, getParentRevisionID, getTitle, getTitle, getUUID
-
Method Details
-
canUserRead
boolean canUserRead() -
canUserWrite
boolean canUserWrite() -
getOwner
MTUserHeader getOwner()Returns "access control" owner of this object.- Returns:
- owner of object
-
setOwner
Sets "access control" owner of this object.- Parameters:
owner
- owner of object
-
getSubscribers
Collection<MTSubscriber> getSubscribers()Returns the subscribers of this model.- Returns:
- The subscribers.
-
setSubscribers
Deprecated.This has been replaced by MTModelStore.setSubscribers which can update subscribers on locked revisions of models. This method should only be called to keep the UI up-to-date, the changes will not be persisted when the model is saved.Sets the subscribers for this model.- Parameters:
subscribers
- The new subscribers for this model.
-
getMaintainers
Collection<MTUserHeader> getMaintainers()Returns the users that have permission to maintain this model.- Returns:
- The maintenance users.
-
setMaintainers
Deprecated.This has been replaced by MTModelStore.setMaintainers which can update maintainers on locked revisions of models. This method should only be called to keep the UI up-to-date, the changes will not be persisted when the model is saved.Sets the users that have permission to maintain this model.- Parameters:
users
- The new maintenance users for this model.
-
getApprovers
Collection<MTUserHeader> getApprovers()Returns the users that have permission to approve this model.- Returns:
- The approvers.
-
setApprovers
Deprecated.This has been replaced by MTModelStore.setApprovers which can update approvers on locked revisions of models. This method should only be called to keep the UI up-to-date, the changes will not be persisted when the model is saved.Sets the users that have permission to approve this model.- Parameters:
users
- The new approvers for this model.
-
getReviewers
Collection<MTUserHeader> getReviewers()Returns the users that have permission to review this model.- Returns:
- The reviewers.
-
setReviewers
Deprecated.This has been replaced by MTModelStore.setReviewers which can update reviewers on locked revisions of models. This method should only be called to keep the UI up-to-date, the changes will not be persisted when the model is saved.Sets the users that have permission to review this model.- Parameters:
users
- The new reviewers for this model.
-
getGroup
MTPermissionGroup getGroup()Returns the "access control" group of this object.- Returns:
- object group
-
setGroup
Set the "access control" group of this object.- Parameters:
group
- The group.
-
getLastModifiedBy
MTUserHeader getLastModifiedBy()Returns the user that last modified this object.- Returns:
- the last user that modified this object.
-
setLastModifiedBy
Set the last user that modified this object.- Parameters:
user
- the last user that modified this object.
-
getCreatedBy
MTUserHeader getCreatedBy() -
setCreatedBy
-
getPermissions
MTPermissions getPermissions()Returns "access control" permissions for this object.- Returns:
- permissions for object
-
setPermissions
Sets "access control" permissions for this object.- Parameters:
permissions
- permissions for this object
-
setPermissions
void setPermissions(int permissions) -
getRemovalHistory
Returns the "history" of removals made in this model. Each time a vertex or edge is removed from a model the UUID will be stored together with the "history path" at the time of removal. Note: This map will not be automatically updated when remove() is called for vertices and edges, you will have to reload the model to get updated data. This should not be a problem since the main purpose of this data is for use when importing/merging models to the repository.- Returns:
- A map where the keys are the UUID:s of removed vertices/edges and the values are their "history paths" at the time of removal.
-
addToRemovalHistory
Adds to the models entries for removed entities (vertices and edges). Note: This method should only be used when importing entities, in order to correctly set the removal history for a newly created model. When removing vertices/edges in existing models through the store API these entries will be created automatically.- Parameters:
removedEntityUUID
- The UUID of the removed vertex/edge.historyPath
- The history path of the vertex/edge at the time of removal.
-
setLastModified
Sets the last modified date for the model. This should only be used to override the date (for example when importing), otherwise it is automatically updated when the model is saved.- Parameters:
date
- The new last modified date
-
setCreated
Sets the creation date for the model. This should only be used to override the date (for example when importing), otherwise it is automatically updated when the model is saved.- Parameters:
date
- The new last modified date
-
getPropertyProviders
Returns all providers that have stored properties.- Returns:
- A set of provider ID:s
- Since:
- 3.0
-
getPropertyKeys
Returns the property names of all properties stored by a provider.- Parameters:
provider
- The provider ID.- Returns:
- A set of property names.
-
getProperty
Returns a property value.- Parameters:
provider
- The ID of the provider that set this property.name
- The property name.- Returns:
- The property value or null.
- Since:
- 3.0
-
setProperty
Sets a property value.- Parameters:
provider
- The ID of the provider setting this property.name
- The property name.value
- The new property value. Values longer than 255 characters will be truncated.- Since:
- 3.0
-
removeProperty
Removes a property.- Parameters:
provider
- The ID of the provider setting this property.name
- The property name.
-
setTranslated
Marks this symbol as translated in the given language.- Parameters:
lang
- The language.translated
- The state to set.- Since:
- 3.1
-
setType
Sets the type of the model. This will not remove existing data but might prevent access to the data if the new type is not recognized as having that data. This is specifically the case for plugin data. Generally, one should not change the type defined by a certain model extension to a type defined by another model extension.- Parameters:
type
- The new type of the model
-
getRevisionLog
List<MTRevisionLogEntry> getRevisionLog()Returns the revision log for this revision of the model.- Returns:
- The revision log.
- Since:
- 3.0
-
setReferenceID
Sets the reference ID of the model. This is the reference ID used to identify the model for example when creating HTML pages. If no reference ID has been set the UUID will be used.- Parameters:
referenceID
- referenceID The new reference ID ornull
to clear the reference ID.- Since:
- 3.1
-
setTitle
Sets the title of the model in the current language.- Parameters:
title
- The new title.- Since:
- 3.0
-
setTitle
Sets the title of the model in a given language.- Parameters:
language
- The language.title
- The new title.- Since:
- 3.0
-
setPrefix
Sets a prefix used to identify this model. If used the prefix can be used for filtering/finding models easier.- Parameters:
prefix
- The prefix to set.
-
setPrefixLocked
void setPrefixLocked(boolean locked) Locks the current prefix so it cannot be modified.- Parameters:
locked
- True to lock prefix, false to unlock.
-
setWorkflowState
Sets the current workflow state.- Parameters:
state
- The new workflow state for the model.
-
setNotify
void setNotify(boolean notify) Sets whether notifications should be sent in next publication.- Parameters:
notify
- True to notify, false otherwise.
-
getAttributes
Returns the attributes connected to the model as a read-only list.- Parameters:
predicate
- A predicate to filter the resulting list.- Returns:
- The attributes connected to the model.
- Since:
- 5.0
-
getAttribute
Returns the attribute of the given type.- Parameters:
type
- the type of the attribute to return- Returns:
- the attribute of the given type
- Throws:
IllegalArgumentException
- If the attribute type is not connected to this model's type- Since:
- 5.0
-
addDocument
Adds a document to the model.- Parameters:
document
- The document to add.- Throws:
MTAccessException
- If an MTAccessException occurs.- Since:
- 3.0
-
removeDocument
Removes a document from the model.- Parameters:
document
- The document to remove.- Throws:
MTAccessException
- If an MTAccessException occurs.- Since:
- 3.0
-
connectDocument
Connects a document to a model.- Parameters:
document
- The document to connect.
-
connectDocument
Connects a document to a model.- Parameters:
id
- The id of the document to connect.
-
disconnectDocument
Disconnects a document from the model.- Parameters:
document
- The document to disconnect.
-
disconnectDocument
Disconnects a document from the model.- Parameters:
id
- The id of the document to disconnect.
-
save
Saves changes made to the model. A model can only be saved in the current workspace.- Throws:
MTAccessException
- If an MTAccessException occurs.MTRemoteChangeException
- If an MTRemoteChangeException occurs.- Since:
- 3.0
-
hasPluginData
boolean hasPluginData()Returns true if there is plug-in data connected to the entity.- Returns:
- true if there is plugin data, false otherwise.
-
lockRevision
MTRevisionOperation lockRevision()Prepares for locking the current revision of the model. Calling this method does not actually lock the revision. It checks against storage which objects will be affected and tries to obtain locks on all the affected models and symbols. The returned operation object can be used to actually perform the lock operation.- Returns:
- A revision operation object that can be used to perform the lock operation assuming that locks could be obtained successfully.
-
changeRevision
MTRevisionOperation changeRevision()Prepares for a change to the current revision of the model, i.e. add a message to the revision log of the current revision. Calling this method does not actually change the revision. It obtains a lock on the model. The returned operation object can be used to actually commit the change to the revision.- Returns:
- A revision operation object that can be used to perform the change operation assuming that a lock could be obtained successfully.
-
createRevision
MTRevisionOperation createRevision()Prepares for creating a new revision of the model. Calling this method does not actually create the revision. It checks against storage which objects will be affected and tries to obtain locks on all the affected models and symbols. The returned operation object can be used to actually perform the create operation.- Returns:
- A revision operation object that can be used to perform the create operation assuming that locks could be obtained successfully.
-
revertToRevision
Prepares for reverting to an earlier revision of the model. If the current revision of this model is open, the data from the earlier revision will be copied to this revision of the model. If the current revision is lost a new revision will be created in the current workspace and the data will be copied to this revision. Note that reverting to a previous revision of a model might cause reverting of the symbols used in the models as well, which might in turn cause new revisions of other models in the workspace using these symbols.- Parameters:
rev
- The revision to revert to.- Returns:
- A revision operation object that can be used to perform the revert operation assuming that locks could be obtained successfully.
-