Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 13:56 Go to next message
Rubia Anjum is currently offline Rubia AnjumFriend
Messages: 7
Registered: January 2020
Junior Member
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 13:57]

Report message to a moderator

Re: Acceleo build [message #1832148 is a reply to message #1832123] Thu, 10 September 2020 07:42 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
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 12:14 Go to previous messageGo to next message
Rubia Anjum is currently offline Rubia AnjumFriend
Messages: 7
Registered: January 2020
Junior Member
[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 12:15 Go to previous messageGo to next message
Rubia Anjum is currently offline Rubia AnjumFriend
Messages: 7
Registered: January 2020
Junior Member
No Message Body

[Updated on: Thu, 10 September 2020 12:17]

Report message to a moderator

Re: Acceleo build [message #1832163 is a reply to message #1832158] Thu, 10 September 2020 13:43 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
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: Tue Apr 23 15:46:58 GMT 2024

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

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

Back to the top