Component Identification

From Developer Documents
Revision as of 06:57, 13 October 2015 by Tuukka Lehtonen (talk | contribs) (→‎Technical details)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Basic concepts


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

  • 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


Open Questions