0
votes

Begin relative new to EMF I can only give sketch of what I want to do. The end product is a eclipse plug-in that have access to at least two EMF models. The first model is created by using Xtext to defined DSL. The second EMF is created using xtend code based on a ecore model.

My questions:

  • How to create a ecore model that will be visible in the plug in?
  • How to create an EMF instance of the ecore model using java/xtend when the code is executed in the plug in. The code snippets I find look like

    val resourceSet = new ResourceSetImpl val resource = resourceSet.getResource(URI.createURI(file), true)

but have no idea what the value of file must be to reference the ecore model.

  • any suggestion of how to translate the one EMF model to the other EMF model.
1

1 Answers

2
votes
  • If I understand correctly, what you want to have is a model in your plug-in that's deployed in your end product. In that case you probably want to look at "platform:/plugin/..." URIs which you can probably use to retrieve artefacts from the running platform.

  • See URI.createURI(String) although you may want to look at URI.createPlatformPluginURI in your case

  • Search for Model-to-Model transformations, which you can specify with a variety of technologies (including Java, Xtend, ATL, etc.)