Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Separate workflow project for emf code generation
Separate workflow project for emf code generation [message #1796960] Tue, 23 October 2018 08:10 Go to next message
Jan Jansen is currently offline Jan JansenFriend
Messages: 15
Registered: October 2018
Junior Member
Hi all,

In our project we have several different modules that require code to be generated using an mwe2 workflow file. These workflow files are all identical, except for the model names; this gave us the idea to make a separate project with one workflow file, and just call this from maven with the parameters for the model names and paths to the projects.

What we have now looks like the following:

The workflow project has the following workflow defined (file name is SingleGenerateEmf.mwe2):


import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl
import org.eclipse.emf.mwe.utils.*

var projectName = ""
var rootPath = ".."
var modelName = "overwritten by pom parameter"

Workflow {
	bean = org.eclipse.xtext.ecore.EcoreSupport {}

	bean = ResourceSetImpl : resourceSet {}
	bean = StandaloneSetup {
		resourceSet = resourceSet
		platformUri = "${rootPath}"
		scanClassPath = true

	component = org.eclipse.emf.mwe2.ecore.EcoreGenerator {
		genModel = "${rootPath}/${projectName}/model/${modelName}.genmodel"
		srcPath = "${rootPath}/${projectName}/emf-gen"

This is then called from the parent pom as follows:
							<cleanupDaemonThreads>false</cleanupDaemonThreads><!-- see -->

The plugin is successfully executed, and in the maven logs I can see that it tries to generate the code for the correct model file:

EcoreGenerator     - generating EMF code for /tmp/generator/code/

But this throws several IOExceptions, because the following files are unmapped (in the project):

  • plugin.xml

How could we resolve this issue?
Re: Separate workflow project for emf code generation [message #1796989 is a reply to message #1796960] Tue, 23 October 2018 15:29 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 30892
Registered: July 2009
Senior Member
According to it's probably better t o use the EMFT forum. But I'm at EclipseCon Europe so I'll ask them if they could have a look here...
Re: Separate workflow project for emf code generation [message #1796995 is a reply to message #1796989] Tue, 23 October 2018 16:32 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 6585
Registered: July 2009
Senior Member

For OCL I aggregate multiple workflows in a an aggregate workflow. See

But re-use of variable names is dangerous., since all initializations occur first then workflows execute. Consequently the initialization for a multiple workflow may be more 'generous' / 'corrupted' compared to a single workflow. Also there is inadequate workflow scoping of variables, so you may want to use distinct names in each workflow rather than "resourceSet" everywhere.

I much prefer to launch manually when actually necessary from a launch config and commit the tested results to GIT for Java builds. Xtext lacks the requisite forward/backward compatibility to allow mindless automatic regeneration of Xtext artefacts; they must be manually approved/worked around before publication. See

Debugging exceptions that only occur within the more challenging/less debuggable Maven environment seems like a waste of time.


Ed Willink
Previous Topic:Concurrent reads after full resource traversal
Next Topic:How to properly limit net4j's thread pool
Goto Forum:

Current Time: Thu Feb 20 15:28:20 GMT 2020

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

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

Back to the top