Replies: 5 comments
-
In EMF, Resources are used to represent/load (and save) the contents of a File (In this case, load the EPackage from the *.ecore file)
And then you can explore the contents of this resource to find the loaded EPackage (Usually, it's the first root element). An optimistic/simplified version:
|
Beta Was this translation helpful? Give feedback.
-
[Leo Knoll] Thanks a lot, I was already on the right track but did not understand the Resource system... |
Beta Was this translation helpful? Give feedback.
-
Ah, yes; in an Eclipse Application this is done automatically; but in a plain Java application you indeed need to register a few things manually |
Beta Was this translation helpful? Give feedback.
-
[Jonas Ebel] Hey I have a follow up issue on this question: When I run the genmodel generation in a docker container I get the exception:
I have a node-alpine running with openjdk-11 on the path. When I execute this command in my linux machine, I do not get this exception. |
Beta Was this translation helpful? Give feedback.
-
[Leo Knoll] It was because of the registering, this one fixes it instead of the previous way it was registered: |
Beta Was this translation helpful? Give feedback.
-
In order to generate a genmodel for code generation for an .ecore file I need to get get the EPackage for the file. I have tried some things but I'm not able to archive this.
As a reference I use this answer for the creation of the genmodel.
https://www.eclipse.org/forums/index.php?t=msg&th=513278&goto=1096737&#msg_1096737
He noted the following:
Please note that this generates a gen model file based on an existing ecore model which has already been imported into an EPackage by reading it using a Resource. Also, not shown here, the resource associated to the EPackage needs to have its URI set to the correct ecore file.
Basically I'm not able to produce the correct EPackage rootPackage which is needed in the code of the link.
original thread by Leo Knoll
Beta Was this translation helpful? Give feedback.
All reactions