| Summary: | Validating multiple dependent ecore files fails | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Modeling] Epsilon | Reporter: | Jack Sleuters <jack.sleuters> | ||||
| Component: | Core | Assignee: | Dimitris Kolovos <dkolovos> | ||||
| Status: | CLOSED FIXED | QA Contact: | |||||
| Severity: | major | ||||||
| Priority: | P3 | CC: | arcanefoam | ||||
| Version: | unspecified | ||||||
| Target Milestone: | --- | ||||||
| Hardware: | PC | ||||||
| OS: | Windows 7 | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
When a model has cross-references to elements of other metamodel, we need to inform the EVL validator about this. The extension point provides the additionalNamespaceURI tag to do this:
<extension
point="org.eclipse.epsilon.evl.emf.validation">
<constraintsBinding
constraints="validation/multi-ecore.evl"
namespaceURI="http://www.example.org/ecore2">
<additionalNamespaceURI
namespaceURI="http://www.example.org/ecore1">
</additionalNamespaceURI>
</constraintsBinding>
</extension>
However, there is a bug because the additional namespace URIs are not being used to register the EVl validator against the EMF validation registry.
This has been fixed in fe47cccfbe1724bfc762063995e11e801ce74f19 and is available in the interim (1.6) build.
Closing since version 2.0. |
Created attachment 209910 [details] Example code showing the bug 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.ecore: ecore1 (namespaceURI ecore1) EClass ecore1 ecore2.ecore: ecore2 (namespaceURI ecore2) EClass ecore2 EClass system 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.