Skip to main content



      Home
Home » Modeling » M2T (model-to-text transformation) » Acceleo build(Showing error when I write in generate.mtl file)
Acceleo build [message #1832123] Wed, 09 September 2020 09:56 Go to next message
Eclipse UserFriend
Errors occurred during the build.
Errors running builder 'Acceleo Builder' on project 'org.eclipse.acceleo.module.sample'.
org.eclipse.emf.ecore.xmi.UnresolvedReferenceException: Unresolved reference '/0/gen'. (platform:/resource/org.eclipse.acceleo.module.sample/bin/org/eclipse/acceleo/module/sample/main/generate.emtl, 293, 57)

Why this error occur and what's the solution for this?

[Updated on: Wed, 09 September 2020 09:57] by Moderator

Re: Acceleo build [message #1832148 is a reply to message #1832123] Thu, 10 September 2020 03:42 Go to previous messageGo to next message
Eclipse UserFriend
Hi

Given your limited description, I can only say that you did something wrong wrt the tool's expectations.

If you read https://wiki.eclipse.org/OCL/ForumNetiquette you may get some tips that avoid the need for long ping pong rallies.

If you read the forum you will find many users who have problems like yours, some are idiot user, some are idiot tool. Without details it is hard to tell which category your problem falls in to.

Regards

Ed Willink
Re: Acceleo build [message #1832157 is a reply to message #1832148] Thu, 10 September 2020 08:14 Go to previous messageGo to next message
Eclipse UserFriend
[comment encoding = UTF-8 /]
[module generate('http://www.eclipse.org/uml2/5.0.0/UML')]

[template public generateElement(c : Class)]

	[file (c.classFileName(), false, 'UTF-8')]
		
	package [c.containingPackages().name->sep('.')/];
	
	//[protected ('imports')]		
	//[/protected]
	
	 public class [c.name.toUpperFirst()/] {

		[for (p: Property | c.attribute) separator('\n')]
	     private [p.type.name/] [p.name/];
	   	[/for]
	
		[for (p: Property | c.attribute) separator('\n')]
	     public [p.type.name/] get[p.name.toUpperFirst()/]() {
	       return this.[p.name/];
	     }
	   	[/for]
	
		[for (o: Operation | c.ownedOperation) separator('\n')]
	     public [o.type.name/] [o.name/]() {
	       	//[protected (o.name)]
			// TODO should be implemented
			//[/protected]
	     }
	   	[/for]
	}
	
	[/file]

[comment if/] 

[/template]
 
Anything written outside this template cause error
[query public classFileName (c:Class):String =
c.qualifiedName().replaceAll('\\.','/').concat('.java')
/]

This is the code I'm writing in generate.mtl file using "acceleo perspective". I'm facing that problem while I write anything outside [template] whether it's [query] or other [template].
The error it shows is below
Errors occurred during the build.
Errors running builder 'Acceleo Builder' on project 'org.eclipse.acceleo.module.sample'.
org.eclipse.emf.ecore.xmi.UnresolvedReferenceException: Unresolved reference '/0/gen'. (platform:/resource/org.eclipse.acceleo.module.sample/bin/org/eclipse/acceleo/module/sample/main/generate.emtl, 293, 57)
Re: Acceleo build [message #1832158 is a reply to message #1832157] Thu, 10 September 2020 08:15 Go to previous messageGo to next message
Eclipse UserFriend
No Message Body

[Updated on: Thu, 10 September 2020 08:17] by Moderator

Re: Acceleo build [message #1832163 is a reply to message #1832158] Thu, 10 September 2020 09:43 Go to previous message
Eclipse UserFriend
Hi

I see no zipped project so I have no idea how you configured tings.

I see http://www.eclipse.org/uml2/5.0.0/UML for which the usual answer is READ THE COMMENTS in the generated main program or the numerous iterations of this same question on this forum.

Regards

Ed Willink
Previous Topic:How to read model of any metamodel in Acceleo?
Next Topic:Yet another enquiry on Maven builds
Goto Forum:
  


Current Time: Thu May 22 19:45:53 EDT 2025

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

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

Back to the top