|How to validate multiple depending ecore models [message #780823]
||Thu, 19 January 2012 14:13
| Jack Sleuters
Registered: January 2012
I'm trying the following on 4 large ecore files, but for sake of simplicity I will explain the problem with a small example.
I've created two ecore files which depend on each other:
ecore2 depends on ecore1
To be able to reference elements of ecore1 from ecore2, in ecore2 I used "Load resource...". The ecore models look as follows:
ecore1 (namespaceURI ecore1)
ecore2 (namespaceURI ecore2)
EReference ecore1: Ecore1 (0 to many, containment true)
EReference ecore2: Ecore2 (0 to many, containment true)
I created genmodels for both ecore files and generated all model, edit, and editor code for both genmodels.
I also created a new plugin project for the validation part. In the manifest, I added "org.eclipse.epsilon.evl.emf.validation (0.9.1)" and "org.eclipse.ui.ide (3.7.0)". Furthermore, I added an "org.eclipse.epsilon.ev.emf.validation" extension with a "constraintsBinding". I set the namespaceURI to "ecore2" because that contains all elements of both ecore models (remember: ecore2 depends on ecore1). The "constraints" point to a .evl file in which, for each EClass in both ecores, a critique with a "check : false" is stated.
After that I run as an eclipse application and create the following model:
System (from ecore2)
Ecore1 (from ecore1)
Ecore2 (from ecore2)
Now, I right click the "System" node and choose "validate". The "Validation Problems" dialog is shown and I only see the critique for Ecore2 being shown. I expected to also see the critique for Ecore1.
I already tried the following:
1. In the "Extension Element Details" of the "constraintsBinding" element, I changed the namespaceURI to ecore1 and run as eclipse application. Right click "System" and press validate. This time a NullPointerException is raised at EvlValidator.java:76)
2. In the "All Extensions" add another "constraintsBinding" this time with namespaceURI "ecore1" using the same constraints file. Run as an eclipse appplication, right click "System" and press validate. This time again NullPointerException is raised at EvlValidator.java:76).
3. I created two validation plugin projects one for ecore1 and one for ecore2. However, again the same NullPointerException was raised.
So finally my question: How do I get this to work?
I added my example code as an attachment.
Powered by FUDForum
. Page generated in 0.08681 seconds