Difference between revisions of "Component Identification"

From Developer Documents
Jump to navigation Jump to search
 
(2 intermediate revisions by the same user not shown)
Line 22: Line 22:
 
</pre>
 
</pre>
 
* The version identifier is a binary GUID and its values can be handled using the utility bean class <code>org.simantics.datatypes.literal</code>.
 
* The version identifier is a binary GUID and its values can be handled using the utility bean class <code>org.simantics.datatypes.literal</code>.
* Identifiers are only given to structural configuration components in a model configuration, not diagram elements. This makes it possible to perform global comparisons between versions of a model.
+
* Identifiers are only given to structural configuration components and composites in a model configuration, not diagram elements. This makes it possible to perform global comparisons between versions of a model.
 +
* GUIDs are written into the standard dependencies Lucene index which means GUIDs can be used to find configuration resources.
 +
* Original GUIDs are preserved in the following operations:
 +
** Cut-pasting content from one diagram to another
 +
** Diagram import with replace option
 +
* Original GUIDs are rewritten in the following operations:
 +
** Diagram import with renaming
 +
** Diagram copy-paste
  
TODO
+
 
 +
* Related code utilities:
 +
<pre>
 +
class ModelingUtils:
 +
    public static List<Resource> searchByGUID(ReadGraph graph, Resource indexRoot, GUID guid) throws DatabaseException
 +
    public static List<Resource> searchByGUID(ReadGraph graph, Resource indexRoot, String indexString) throws DatabaseException
 +
    public static void rewriteGUIDS(WriteGraph graph, Resource root, boolean deep) throws DatabaseException
 +
    public static void createMissingGUIDs(IProgressMonitor monitor, WriteGraph graph, Collection<Resource> roots) throws DatabaseException
 +
</pre>
  
 
= Examples =
 
= Examples =
  
 
= Open Questions =
 
= Open Questions =

Latest revision as of 06:57, 13 October 2015

Basic concepts

Rationale

TODO: unique identifiers for entities like structural components, really making sure that an entity is the same as another in distributed team work

Use cases

TODO
  • Management of shared modelling concepts using export/import or shared repository
  • Full-featured inspection of old versions
  • Version comparison analysis tools

Technical details

  • A unique identifier can be attached to any resource with the L0.identifier relation:
    >-- L0.identifier <R L0.HasProperty : L0.FunctionalRelation
        L0.HasLabel "Identifier"
        --> L0.GUID
  • The version identifier is a binary GUID and its values can be handled using the utility bean class org.simantics.datatypes.literal.
  • Identifiers are only given to structural configuration components and composites in a model configuration, not diagram elements. This makes it possible to perform global comparisons between versions of a model.
  • GUIDs are written into the standard dependencies Lucene index which means GUIDs can be used to find configuration resources.
  • Original GUIDs are preserved in the following operations:
    • Cut-pasting content from one diagram to another
    • Diagram import with replace option
  • Original GUIDs are rewritten in the following operations:
    • Diagram import with renaming
    • Diagram copy-paste


  • Related code utilities:
class ModelingUtils:
    public static List<Resource> searchByGUID(ReadGraph graph, Resource indexRoot, GUID guid) throws DatabaseException
    public static List<Resource> searchByGUID(ReadGraph graph, Resource indexRoot, String indexString) throws DatabaseException
    public static void rewriteGUIDS(WriteGraph graph, Resource root, boolean deep) throws DatabaseException
    public static void createMissingGUIDs(IProgressMonitor monitor, WriteGraph graph, Collection<Resource> roots) throws DatabaseException

Examples

Open Questions