Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Running Acceleo from within Sirius(Calling an Acceleo Generation from SIirius using Java Services )
Running Acceleo from within Sirius [message #1841775] Fri, 28 May 2021 09:51 Go to next message
Aon Safdar is currently offline Aon SafdarFriend
Messages: 5
Registered: May 2021
Junior Member
I am trying to run a simple Acceleo generation pragmatically from within a Java Services class of my Sirius Viewpoint Specification Project. I can run the Acceleo mtl from 'Run Configuration' and it works fine but When i try to do it from Java Services Class inside Sirius Viewpoint Specification project it doesn't work. I am using Generate.java (created by Acceleo for my generate.mtl file) to run it. I've added the Accelo project as a dependencies in the bulid path of Sirius Project .
package filefolder.project.design;

import org.eclipse.emf.ecore.EObject;

import filnfol.acceleo.main.Generate;

/**
 * The services class used by VSM.
 */
public class Services {
 
    public void myService(EObject self, String arg) {
    	 String [] abc = new String[2];
   	  abc[0] =  "C:/Users/Aon/runtime-EclipseApplication/filnfol/My.fsys";
	        abc[1] = "C:/Users/Aon/Try";
	        Generate.main(abc);   
    }
}



Important to highlight that I am trying this in Eclipse Runtime where I have created an Instance of my metamodel called 'My.fsys'. If i write the same code in a separate java project, it works. But in using Sirius Java Services method it doesnot run. It dosent give any error but does not go beyond the Generate.main() method.
Re: Running Acceleo from within Sirius [message #1841778 is a reply to message #1841775] Fri, 28 May 2021 11:20 Go to previous messageGo to next message
Aon Safdar is currently offline Aon SafdarFriend
Messages: 5
Registered: May 2021
Junior Member
I managed to resolve the issue using doGenerate method of the Java Luncher class. Thanks
Re: Running Acceleo from within Sirius [message #1851268 is a reply to message #1841778] Fri, 01 April 2022 07:33 Go to previous message
Simon Tulia is currently offline Simon TuliaFriend
Messages: 14
Registered: January 2022
Junior Member
Hello Aon, I am struggling with a similar issue. Are you able to call a Java query from an .mtl file? I am able to run .mtl file by calling doGenerate function just like you. However, the queries do not work and I am getting a "Class .... Couldn't be found in the classpath of the bundle containing module ....emtl". By the way, I can do the same thing if I do not use it in a Sirius project.
Previous Topic:Edge creation maps multiple edges
Next Topic:Constraints validation when entering a value in Sirius Editor
Goto Forum:
  


Current Time: Wed Apr 24 19:25:39 GMT 2024

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

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

Back to the top