Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » [EVL] Validation of linked model instances
[EVL] Validation of linked model instances [message #1726643] Tue, 15 March 2016 10:49 Go to next message
Glatz Martin is currently offline Glatz MartinFriend
Messages: 16
Registered: March 2016
Junior Member
Hello,

I'm interested whats the most simple/straightforward solution to overcome following situation and would appreciate tipps:

I'm having a metamodel which basically stores 4 different "libaries" as trees, and in addition can have external references, which comply to the same metamodel. The problem is - the reference in the model instance is a URi to the file, where the referenced model instance is located.

So basically:

root
-externalReferenceTolib1a
-externalReferenceToLib2a
-lib1
-lib2
-lib3
-lib4

The EVL rules have to apply for the "root" model instance as well as the external referenced models (it is not enough to vaidate each model on it's own).

Is there a simple way to dynamically load the models which are referenced with the URi's and "link" it to the root-model?

Thanks a lot in advance,
Best regards
Martin
Re: [EVL] Validation of linked model instances [message #1726656 is a reply to message #1726643] Tue, 15 March 2016 11:27 Go to previous messageGo to next message
Antonio Garcia-Dominguez is currently offline Antonio Garcia-DominguezFriend
Messages: 470
Registered: January 2010
Senior Member
This should Just Work (TM), as long as you use standard cross-resource EReferences to join up the different files and check the "Include external file references" box in the EMF model that you use in the EVL launch configuration.

I've attached a simple example that does just that: it runs an EVL validation on the main model, which has a reference to an external model. As long as you check the "Include external file references" box, it will find the tree node with a negative integer value.

Note: to create these cross-resource references, just open the main model, right-click on the background of the editor and use "Load Resource..." to load the other model into the same ResourceSet. You should be then able to select the objects of the other resource as targets to your references as well, and EVL will be able to follow those references automatically.

[Updated on: Tue, 15 March 2016 11:30]

Report message to a moderator

Re: [EVL] Validation of linked model instances [message #1727176 is a reply to message #1726656] Mon, 21 March 2016 00:11 Go to previous messageGo to next message
Glatz Martin is currently offline Glatz MartinFriend
Messages: 16
Registered: March 2016
Junior Member
Hello Antonio,

sorry for late reply - thank you very much for your example.

The problem I was facing is that my input for validation is a XML based on a schema and the type of the reference is just a String:
<externalReference alias="BaseRoleClassLib" path="Libs/RoleClass Libraries/AutomationMLBaseRoleClassLib.aml">

I've created in the meantime an additional EReference within my metamodel - I load the referenced model in Java code and set the EReference - then I get:
<externalReference alias="BaseRoleClassLib" path="Libs/RoleClass Libraries/AutomationMLBaseRoleClassLib.aml">
<linkedModel href="./bin/amlValidationSuite/models/AutomationMLBaseRoleClassLib.xmi#/"/>
</externalReference>

after I call store();
But - and I'm not sure it its intentionally - if I hand over the model then to the model repository the referenced model is ignored - also a load of the same model didn't solve the problem (EmfModel.PROPERTY_CACHED is set to false during load)

After a lot of try and error I found out that I have to call disposeModel in EmfModel and reload the model that it works - dispose (in IModel) didn't work either.

The question is - is this a bug or a feature?

Best regards,
Martin

[Updated on: Mon, 21 March 2016 07:15]

Report message to a moderator

Re: [EVL] Validation of linked model instances [message #1728016 is a reply to message #1727176] Wed, 30 March 2016 09:14 Go to previous message
Antonio Garcia-Dominguez is currently offline Antonio Garcia-DominguezFriend
Messages: 470
Registered: January 2010
Senior Member
Hi Martin,

Sorry for the delay - Easter came up and all that Smile. It sounds like a bug: could you provide a minimal example that reproduces this? [1]

[1]: http://www.eclipse.org/epsilon/doc/articles/minimal-examples/

Kind regards,
Antonio
Previous Topic:EVL: How to determine there is no unsatisfied constraint in a module
Next Topic:[EuGENia]Labels for link
Goto Forum:
  


Current Time: Tue Jan 23 08:23:49 GMT 2018

Powered by FUDForum. Page generated in 0.01820 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software