This repository has a minimal example to reproduce the error of EPackage registry by Eclipse Epsilon operation.
- Java Development Kit v8
- Eclipse Neon. Include this Plugins:
- Eclipse Epsilon 1.3
- Eclipse Sirius 4
- OCLTools
- GMF
- EEF
- Acceleo
This repository has 4 projects, the most important is "EPackageRegistryExample" in which has the core assets to reproduce the error. The others projects are a complement to has a Sirius Editor.
In this order of ideas, "EPackeageRegistryExample" has a folder called "Core" that contents:
- MetamodelSetterExampl.eol -> code to register EPackager by EOL script.
- SiriusSpecsCorrectExample.xmi -> It's a specs model of Eclipse Siruis with a correct configuration of metamodels.
- SiriusSpecsGenerated.xmi -> It's a specs model of Eclipse Siruis that will use has input of the EOL script, that has not a metamodels configuration.
- SimpleOO.ecore -> It's a metamodel that will add as metamodel configuration in the Sirius specs.
- DatasetForSiriusTest.xmi -> It's dynamic instance from SimpleOO.ecore. This will use to test the Sirius Editor with the metamodels configuration.
- backup -> i't s a folder that contents backups of: a DatasetForSiriusTest.xmi and SiriusSpecsGenerated.xmi.
Step 1: Import Projects.
- Import all projects in your Eclipse Instance.
- Open the Principal project "EPackageRegistryExample".
- Open the folder "Core".
- Register SimpleOO.ecore with right-click.
Step 2: Check Ecore Estructure
- Open SimpleOO.ecore file.
- Check Ns URI configuration to have idea of the correct result.
Step 3: Open SiriusSpecsGenerated.xmi
- With right-click, open the file "SiriusSpecsGenerated.xmi" with the Text Editor.
- Verify that has not any metamodel tag.
If the correct must see it like this:
Step 4: Open MetamodelSetterExample.eol
- Open the file called "MetamodelSetterExample.eol".
- Consider the following:
- This script calls a java native class called "EmfTool", this class allows to get EPackages registered on the EMF Registry.
- In the line 7 and 10, we get two EPackage from the EMF Registry with the NsUri of each one.
- In the line 16 and 17, we add the epackages as metamodels required for the Sirius specs.
- Close the file and pass to the next step.
Step 5: Configure EOL Program.
-
With double-click, create a new configuration for a "EOL Program", set source configuration the file "MetamodelSetterExample.eol" and set the name with "MetamodelSetterExample".
-
Open the models tab and add a new model with this configuration.
- As result you will has this.
Step 6: Run EOL Program
Step 7: Compare the result.
-
Check in the file "SiriusSpecsGenerated.xmi" with the text editor, and you will find this tags:
-
Now, open the file "SiriusSpecsCorrectExample.xmi" and find the same tags.
This is the problem, the URI are not the same. I guess because the second file ("SiriusSpecsCorrectExample.xmi") was configurated manually and in a second instance of Eclipse with the Sirius Editor as a plugin, therefore, it hasn't the same runtime and that make a reference with a different URI.
Step 8: Test Sirius Specs.
- In run configuration, create a Eclipse Application and run this as a second instance.
- In the second instance, create a Modeling Project called "Example".
- Copy the files SiriusSpecsCorrectExample.xmi, SiriusSpecsGenerated.xmi and DatasetForSiriusText.xmi.
Valite the metamodel configuration as the image example.