Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Using Ecore2Java with dependent models(CI/CD setup for EMF)
Using Ecore2Java with dependent models [message #1844203] Mon, 06 September 2021 10:28 Go to next message
Jörn Guy Süß is currently offline Jörn Guy SüßFriend
Messages: 320
Registered: July 2009
Location: Anstead, Brisbane, Queens...
Senior Member

I have a set of models that have inter-model dependencies, that is:
a client EPackage in one Plugin containing EClasses which are subclasses of EClasses residing in another EPackage inthe supplier Plugin.
I want to generate the two plugins using one execution of Ecore2Java, without installing the supplier in the runtime first.
I do not want to duplicate the classes, but use the OSGI manifest and Java package import mechanism.

  • Is this possible?
  • Is there an example for such execution?
  • Where could I find it?

I would believe that this is a fairly basic requirement for CI/CD with models. So I am surprised not to find any examples.

[Updated on: Mon, 06 September 2021 10:29]

Report message to a moderator

Re: Using Ecore2Java with dependent models [message #1844206 is a reply to message #1844203] Mon, 06 September 2021 10:48 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33143
Registered: July 2009
Senior Member
I'm really not sure what you are wanting. Of course there are many examples of models that depend on other models. E.g., Change.ecore uses EClasses from Ecore.ecore.

The Ecore2Java Ant support works with a single *.genmodel and will generate only a single model plugin (long with edit, editor, and test plugins if you so choose). But if you want multiple model plugins, you will need multiple *.genmodels and multiple executions of the Ant task.

Of course if you have a model that depends on another model, the model on which it depends must be available at generation time. When working in the IDE that means it must be available as a source project or it must be available in PDE's target platform (which, if you don't configure it, defaults to the running IDE plugins and features).


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Using Ecore2Java with dependent models [message #1844208 is a reply to message #1844206] Mon, 06 September 2021 11:19 Go to previous messageGo to next message
Jörn Guy Süß is currently offline Jörn Guy SüßFriend
Messages: 320
Registered: July 2009
Location: Anstead, Brisbane, Queens...
Senior Member

I am looking for an example of an ant build that performs invocations for a supplier model, and a client model in sequence. On the client call, the supplier is generated and hence available in source form. I have not found an example of such an execution in an ant script.

I am aware and have used the supplier models in the target platform. I want to avoid this.

I am also aware that Ecore2Java only uses one genmodel per build and can reference multiple ecore models.

I hope this clarifies my intent.

[Updated on: Mon, 06 September 2021 11:25]

Report message to a moderator

Re: Using Ecore2Java with dependent models [message #1844210 is a reply to message #1844208] Mon, 06 September 2021 12:03 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33143
Registered: July 2009
Senior Member
The *.genmodel of the supplier model must be available when the client model is generated. If you look in the client's *.gemodel's XMI, you'll see it has a reference like this

usedGenPackages="../../org.eclipse.emf.ecore/model/Ecore.genmodel#//ecore"

This reference must resolve and there's no avoiding that need.

There aren't many examples of how to use Ant because not many people use it.


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Using Ecore2Java with dependent models [message #1844215 is a reply to message #1844210] Mon, 06 September 2021 12:55 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

Since so few people use the Ant approach, certainly I have never used it, and quite possibly nobody has used it for a multi-package model, you may be in virgin territory.

My best guess is that the ,,/.. reference from one genmodel to another fails because the platform: virtual file root has not been correctly configured. I suggest instrumenting ResourceSet.getResource() and ResourceImpl() to see what resource fetches are attempted and what succeeds. Make sure that the ExtensionProcessor has been invoked to configure mappings and see whether they look sensible and include everything that you need.

Regards

Ed Willink
Re: Using Ecore2Java with dependent models [message #1844216 is a reply to message #1844215] Mon, 06 September 2021 13:13 Go to previous messageGo to next message
Jörn Guy Süß is currently offline Jörn Guy SüßFriend
Messages: 320
Registered: July 2009
Location: Anstead, Brisbane, Queens...
Senior Member

That is exactly the detail had required. Thanks. If I get this to work, where would be a good place to deposit the example?

I am using Epsilon toolchain to prepare that step and have easy access to this information. I will generate the metamodel and add the reference.

I find it peculiar that there is no integrated approach to building componentized models. Is that not what this is all about.

Regarding use of ant I find that this is the only platform that allows to use multiple MDE tools and toolchains and make use of the platform facilities at the same time. Of course that only works if people do not spaghetti-glue their build-tools to the user interface.

Too many islands and little kings. Too much mouse-clicking, too little CI.

I wish I had a Gradle implementation with OSGI access akin to the antrunner application, but no time to do something so fundamental.

Again, thanks for the help.

[Updated on: Mon, 06 September 2021 13:22]

Report message to a moderator

Re: Using Ecore2Java with dependent models [message #1844230 is a reply to message #1844216] Mon, 06 September 2021 19:23 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

For QVTd I have four of five layers of models and build them very happily with MWE2, so you're determination to use an inappropriate technology is the source of your difficulties.

Regards

Ed Willink
Re: Using Ecore2Java with dependent models [message #1844234 is a reply to message #1844230] Mon, 06 September 2021 22:15 Go to previous messageGo to next message
Jörn Guy Süß is currently offline Jörn Guy SüßFriend
Messages: 320
Registered: July 2009
Location: Anstead, Brisbane, Queens...
Senior Member

Thanks Ed. That is helpful.

[Updated on: Mon, 06 September 2021 22:22]

Report message to a moderator

Re: Using Ecore2Java with dependent models [message #1844366 is a reply to message #1844234] Sat, 11 September 2021 06:24 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi Joern

I'm sorry that my comments have been a bit harsh. They made me reflect.

In principle, Ant should be far superior to MWE2.
+ much larger developer/user base
+ much more mature
+ much larger task library
+ better documented tasks
But
- not debuggable in Eclipse
- XML syntax is an offence to readability

MWE was also XML syntax, but evolved
+ MWE2 has a sensible syntax and editor
+ MWE2 is debuggable in Eclipse.
But
- the declining developer base puts MWE2 at risk.

Syntax is a minor issue mitigated by a decent editor. Debugging is the killer.

I searched Bugzilla and found https://bugs.eclipse.org/bugs/show_bug.cgi?id=24130

Reopening a 19-year old WONTFIX is a bit pointless so I raised https://bugs.eclipse.org/bugs/show_bug.cgi?id=575920 that might survive as a "helpwanted".

Maybe it's the kind of simple self-standing problem that I might turn my attention to once I finally accept that QVTd will not take off.

----

WorkflowAntTask is interesting but the wrong way round; it can rescue legacy MWE2 for use in Ant.

What might help is an Ant launch from within MWE2 but if that provides debugging, it just demonstrates how disgraceful the IDE Ant launch is.

Regards

Ed Willink
Re: Using Ecore2Java with dependent models [message #1844400 is a reply to message #1844366] Mon, 13 September 2021 05:34 Go to previous message
Jörn Guy Süß is currently offline Jörn Guy SüßFriend
Messages: 320
Registered: July 2009
Location: Anstead, Brisbane, Queens...
Senior Member

Hi Ed,

I know how awful Ant is. Really do. I am not endorsing its design at all. My aim is to use it as a dispatch point to get a wide scope of MDE tools.

The reason I was after Ecore2java is that Epsilon's Eugenia Ant support, which is excellent, is currently intertwined with, you guessed it, the Eclipse workbench. While this gets sorted out, I needed a way to build our four-level model hierarchy. So I thought that like in a car, the on-board tools may be ugly and cumbersome, but must work.

On prior topic: To mitigate the horrific nature of Ant, I have set up a structured development method in our company. During development time, this gives clarity.

We have exploited Tycho's Test Environment in conjunction with AntUnit and the Eclipse Ant Runner dispatch to allow us to test and cover interactions. AntUnit allows us to do wider coverage of the dispatch. And the rest has to be unit tested.

Using the Eclipse infrastructure frees us from dependency hell. The tasks are Eclipse features. You install them by director call on the shell into the builder, then you run your model-driven build. Or you use the tasks in your IDE. Works the same way. Most of those builders are pre-packaged in containers though.

My devs were initially very sceptical of this design. But it works far better then expected.

All the best from Brisbane, JG

[Updated on: Mon, 13 September 2021 05:35]

Report message to a moderator

Previous Topic:Ecore for mapping metamodel
Next Topic:[CDO] Weird Issue with resources
Goto Forum:
  


Current Time: Thu May 02 07:50:38 GMT 2024

Powered by FUDForum. Page generated in 0.03752 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top