mondo-project / mondo-hawk

Heterogeneous model indexing solution, based on NoSQL stores.
Eclipse Public License 2.0
17 stars 5 forks source link

Cannot index UML models with profiles #17

Closed agarciadom closed 8 years ago

agarciadom commented 8 years ago

I have produced a simple Modelio project containing a UML model of the reverse engineered sources of org.hawk.core:

https://drive.google.com/file/d/0By746w15lFC4b3hNYWlvVTFRd0U/view?usp=sharing

Since our public binaries do not include the Modelio driver (as it is GPL-licensed), I have tried exporting the project to XMI and using that:

https://drive.google.com/file/d/0By746w15lFC4bjVzQldoZEJSYVE/view?usp=sharing

However, that does not work either: Hawk complains saying that it cannot find an EPackage that is contributed by one of the exported profiles.

!ENTRY org.hawk.ui2 1 0 2015-11-13 11:53:31.031
!MESSAGE 0s698ms
calculateModelDeltaSize() called:
WARNING: no file node found for: org.hawk.core.xmi
file not in store, performing initial batch file insertion
File: org.hawk.core.xmi
ADDING: java.lang.Exception: Metamodel http:///schemas/JavaExtensions/_7r5RYInuEeWb26aBU27tGw/0 does not have a Node associated with it in the store, please make sure it has been inserted
    at org.hawk.graph.internal.updater.GraphModelBatchInjector.getEClassNode(GraphModelBatchInjector.java:676)
    at org.hawk.graph.internal.updater.GraphModelBatchInjector.addEObject(GraphModelBatchInjector.java:739)
    at org.hawk.graph.internal.updater.GraphModelBatchInjector.parseResource(GraphModelBatchInjector.java:270)
    at org.hawk.graph.internal.updater.GraphModelBatchInjector.<init>(GraphModelBatchInjector.java:143)
    at org.hawk.graph.internal.updater.GraphModelInserter.addNodes(GraphModelInserter.java:761)
    at org.hawk.graph.internal.updater.GraphModelInserter.run(GraphModelInserter.java:125)
    at org.hawk.graph.internal.updater.GraphModelUpdater.updateStore(GraphModelUpdater.java:76)
    at org.hawk.core.runtime.ModelIndexerImpl.internalSynchronise(ModelIndexerImpl.java:329)
    at org.hawk.core.runtime.ModelIndexerImpl.runUpdateTask(ModelIndexerImpl.java:856)
    at org.hawk.core.runtime.ModelIndexerImpl.access$0(ModelIndexerImpl.java:847)
    at org.hawk.core.runtime.ModelIndexerImpl$RunUpdateTask.run(ModelIndexerImpl.java:71)
    at java.util.TimerThread.mainLoop(Timer.java:555)
    at java.util.TimerThread.run(Timer.java:505)
ParseMResource Exception on file: org.hawk.core.xmi
Reverting all changes on that file.
WARNING: no file node found for: org.hawk.core.xmi
model insertion aborted: see above error (maybe you need to register the metamodel?)
(took ~0sec to commit changes)

Fixing this would probably require a proper UML model driver from Hawk, that could read .profile.xmi files as actual metamodels.

agarciadom commented 8 years ago

It was easier than I thought: we just had to modify Modelio so it could understand .profile.xmi as metamodels. We've also extended the EMF metamodel parser so users that don't have the Modelio driver installed can use a Java system property to have it parse .profile.xmi as a metamodel as well.