Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » EGL template operations error
EGL template operations error [message #1791084] Fri, 22 June 2018 15:00 Go to next message
Michiel Fortuin is currently offline Michiel FortuinFriend
Messages: 9
Registered: May 2018
Junior Member
I get the following error:
Method 'Generate' not found for: org.eclipse.emf.ecore.impl.DynamicEObjectImpl@8ed9db [eClass: org.eclipse.emf.ecore.impl.EClassImpl@17a6f44 [name: FileImage] [instanceClassName: null] [abstract: false, interface: false]]

with the following EGL file:
[% var cluster : Cluster = Cluster.all.first; %]

Start file
[% for (i in cluster.Instrument) { %]
	[% if (i.Images->size() > 0) { %]
		start
		[% for (img in i.Images) { %]
			[%=img.Generate() %]
		[% } %]
		end
	[% } %]
[% } %]
End file

[%

@template
operation FileImage Generate() { %]
	"[%=self.URL%]"
[% }

@template
operation NoneImage Generate() { %]
	""
[% }

%]


Why can't it find the generate function?
Re: EGL template operations error [message #1791088 is a reply to message #1791084] Fri, 22 June 2018 16:54 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2163
Registered: July 2009
Location: York, UK
Senior Member

Hi Michiel,

Could you please provide a minimal example [1] I can use to reproduce this locally?

Cheers,
Dimitris

[1] https://www.eclipse.org/epsilon/doc/articles/minimal-examples/
Re: EGL template operations error [message #1791109 is a reply to message #1791088] Sat, 23 June 2018 10:07 Go to previous messageGo to next message
Michiel Fortuin is currently offline Michiel FortuinFriend
Messages: 9
Registered: May 2018
Junior Member
hi,

I tried to create a minimal example and I did not succeed with that.
The problem did not exist in the EGL template but in an ETL transformation.
The transformation was from one model to another model in which the metamodels of those model both defines there own FileImage.
Somehow it was possible that a FileImage from the original model was copied to the generated model and not transformed.
I only found this out by removed completely the first transformation and all references to the original model and metamodel.
by changing the := to ::= the error was immediately solved.

It would be handy to see in the error in which namespace the object lives that gives the error.
Of give an option like ATL to disallow intermodel references.
Re: EGL template operations error [message #1791110 is a reply to message #1791109] Sat, 23 June 2018 10:13 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2163
Registered: July 2009
Location: York, UK
Senior Member

Hi Michiel,

I'm glad this works now. Off the top of my head, to see the namespace of an object "o" you can use an expression like o.eClass().getEPackage().getNsURI().

Cheers,
Dimitris
Re: EGL template operations error [message #1791111 is a reply to message #1791110] Sat, 23 June 2018 11:46 Go to previous message
Michiel Fortuin is currently offline Michiel FortuinFriend
Messages: 9
Registered: May 2018
Junior Member
yeah, sure, but I assumed that it was not possible, so I did not check for it and it was also not specified in the error shown.
Next time that could be handy :)

thanks

Michiel
Previous Topic:Licensing
Next Topic:Epsilon ETL/EOL String to Double using isReal conversion gives Float Cast exception
Goto Forum:
  


Current Time: Thu Apr 25 18:56:04 GMT 2024

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

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

Back to the top