Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » [Acceleo] Problems generating from a referenced metamodel
[Acceleo] Problems generating from a referenced metamodel [message #1705441] Sat, 15 August 2015 14:09 Go to next message
Nikita Duemmel is currently offline Nikita DuemmelFriend
Messages: 1
Registered: August 2015
Junior Member

I am creating a MoDisco discoverer for eclipse plugins, which gathers the information about those plugins into a model. That model is referencing the MoDisco java metamodel for java specific objects like Packages and CompilationUnits. Furthermore my task is to be able to generate a new plugin project from a discovered model.

However I have run into some issues when trying to generate the MANIFEST.MF file using Acceleo 3.4.2 on Kepler using a running eclipse instance (debugging as Acceleo plugin application works fine).

When generating the file I get following warnings and errors:
Invalid type for iteration at line 34 in Module generateProjectFiles for block for (m.exportedPackages) separator(',
'). was not an instanceof Package.

Error #1 (I get it twice):
Evaluation failed with an exception: (no message)
	at org.eclipse.ocl.ecore.EcoreEvaluationEnvironment.navigateProperty(
	at org.eclipse.ocl.ecore.EcoreEvaluationEnvironment.navigateProperty(

Error #2:
Operation replaceAll(String, String) is undefined on type org.eclipse.ocl.ecore.internal.OCLStandardLibraryImpl$1.
java.lang.UnsupportedOperationException: Operation replaceAll(String, String) is undefined on type org.eclipse.ocl.ecore.internal.OCLStandardLibraryImpl$1.
	at org.eclipse.acceleo.engine.internal.environment.AcceleoLibraryOperationVisitor.getExceptionOperationCallFailed(
	at org.eclipse.acceleo.engine.internal.environment.AcceleoLibraryOperationVisitor.callNonStandardOperation(

When Im using the Acceleo interpreter in the running instance I get some mixed results:
If I use [self.ancestors().eGet('name')->last()/] on a Package object directly I get the correct result.
Using [self.activator._package.ancestors().eGet('name')->last() + '.' +'.java', '')/] on the manifest object likewise returns the correct result.
However I get following errors, which seem to correspond with the warning I get each time when generating the file, when using [for (p : Package | self.exportedPackages) separator (',\n')] [p.ancestors().eGet('name')->last()/][/for]
Invalid Type: Package
Incomplete reference to variable declaration in variable expression: (p)

Here is the .mtl with the relevant stuff to keep it short:
[comment encoding = UTF-8 /]
[module generateProjectFiles('http://de.ubt.ai1.modisco.eclipse.project.discoverer', '')]

[template public generateElement(aPManifest : PManifest) post (trim())]
[file ('META-INF/MANIFEST.MF', false, 'UTF-8')]
Manifest-Version: 1.0
Bundle-ManifestVersion: 2[generateConditionalStuff(aPManifest)/]
Bundle-SymbolicName: [][if (aPManifest.singleton = true)];singleton:=true[/if]
Bundle-Version: [aPManifest.version/][generateRequiredBundles(aPManifest)/][generateExportedPackages(aPManifest)/]
Bundle-Activator: [getActivator2(aPManifest)/]
Bundle-RequiredExecutionEnvironment: [aPManifest.project.jreVersion/]
Bundle-ActivationPolicy: lazy

[template public generateExportedPackages(m : PManifest)]
[if (m.exportedPackages->size() > 0)][lineSeparator()/]Export-Package:[for (p : Package | m.exportedPackages) separator (',\n')] [p.ancestors().eGet('name')->last()/][/for][/if]

[template public generateExportedPackages2(m : PManifest)]
[if (m.exportedPackages->size() > 0)][lineSeparator()/]Export-Package:[getExportPackages(m)/][/if]

[query public getActivator(manifest : PManifest) : String = 
	manifest.activator._package.ancestors().eGet('name')->last() + '.' +'.java', '') /]

[query public getActivator2(manifest : PManifest) : String = 
	invoke('de.ubt.ai1.modisco.project.generation.main.Util', 'getActivator(projectModel.PManifest)', Sequence{manifest}) /]

[query public getExportPackages(manifest : PManifest) : String = 
	invoke('de.ubt.ai1.modisco.project.generation.main.Util', 'getExportPackages(projectModel.PManifest)', Sequence{manifest}) /]

How it looks like:
Bundle-Activator: invalid.invalid

How it should look like (using java services or debug as acceleo application):
Export-Package: org.eclipse.modisco.workflow,
Bundle-Activator: org.eclipse.modisco.workflow.Activator

I also get following errors:
There seem to be some errors in one of the file '', therefore JMerge can not be used.
A problem was detected while parsing a Java file
Line 52: Syntax error, parameterized types are only available if source level is 1.5 or greater
Line 52: Syntax error, parameterized types are only available if source level is 1.5 or greater
which appear to be same errors as in this thread however the generation still seems to work more or less.

Any ideas?

Nikita Dümmel.
Re: [Acceleo] Problems generating from a referenced metamodel [message #1742922 is a reply to message #1705441] Thu, 08 September 2016 15:17 Go to previous message
pere joseph rodríguez is currently offline pere joseph rodríguezFriend
Messages: 47
Registered: October 2014
to which metamodel belongs Package?
Previous Topic:Count attributes in a model
Next Topic:Best method for generating code from XSD
Goto Forum:

Current Time: Thu Nov 30 10:58:10 GMT 2023

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

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

Back to the top