Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » [Acceleo] Problem with file generation
[Acceleo] Problem with file generation [message #1234090] Tue, 21 January 2014 08:08 Go to next message
Marc-Florian Wendland is currently offline Marc-Florian Wendland
Messages: 67
Registered: January 2013
Member
Hi all,
very strange, I executed the day before yesterday rather my code generator
with UML2 elements and it worked as expected. Without any noticible reason
(at least, I have not noticed it), I get the following warning:

!ENTRY org.eclipse.acceleo.engine 2 0 2014-01-21 08:47:27.999
!MESSAGE The generation failed to generate any file because there are no
model elements that matches at least the type of the first parameter of one
of your main templates.
The problem may be caused by a problem with the registration of your
metamodel, please see the method named "registerPackages" in the Java
launcher of your generator. It could also come from a missing [comment
@main/]
in the template used as the entry point of the generation.

The main template (which worked a dozen of times) looks like:

[template public utp2ttcn3(testContextAI : InstanceSpecification)]
[comment @main/]
[file('test.tl', false, 'UTF-8']
[testContextAI.name/]
[/file]
[/template]

It will not generate the file any more du to the above mentioned warning. I
can access the UML metamodel in my template editor with code completion
working as expected.

I made a test and changed the main template as follows:

[template public utp2ttcn3(testContextAI : EObject)]
[comment @main/]
[file('test.tl', false, 'UTF-8']
[testContextAI/]
[/file]
[/template]

It writes the file and puts

org.eclipse.uml2.uml.internal.impl.InstanceSpecificationImpl@1db60321 (name:
TestContextArtifactInstance, visibility: <unset>)

into it.

I do not know why this suddenly happened and I am grateful for any hint.

Regards,
Marc-Florian
Re: [Acceleo] Problem with file generation [message #1234163 is a reply to message #1234090] Tue, 21 January 2014 11:24 Go to previous messageGo to next message
Ed Willink is currently offline Ed Willink
Messages: 4086
Registered: July 2009
Senior Member
HI

If you are following the very latest UML N-builds you will have just
switched fronm 4.0 to 5.0 as part of the UML 2.5 support. This could
certainly cause surprises since it is work in progress.

Regards

Ed Willink

On 21/01/2014 08:08, Marc-Florian Wendland wrote:
> Hi all,
> very strange, I executed the day before yesterday rather my code
> generator with UML2 elements and it worked as expected. Without any
> noticible reason (at least, I have not noticed it), I get the
> following warning:
>
> !ENTRY org.eclipse.acceleo.engine 2 0 2014-01-21 08:47:27.999
> !MESSAGE The generation failed to generate any file because there are
> no model elements that matches at least the type of the first
> parameter of one of your main templates.
> The problem may be caused by a problem with the registration of your
> metamodel, please see the method named "registerPackages" in the Java
> launcher of your generator. It could also come from a missing [comment
> @main/]
> in the template used as the entry point of the generation.
>
> The main template (which worked a dozen of times) looks like:
>
> [template public utp2ttcn3(testContextAI : InstanceSpecification)]
> [comment @main/]
> [file('test.tl', false, 'UTF-8']
> [testContextAI.name/]
> [/file]
> [/template]
>
> It will not generate the file any more du to the above mentioned
> warning. I can access the UML metamodel in my template editor with
> code completion working as expected.
>
> I made a test and changed the main template as follows:
>
> [template public utp2ttcn3(testContextAI : EObject)]
> [comment @main/]
> [file('test.tl', false, 'UTF-8']
> [testContextAI/]
> [/file]
> [/template]
>
> It writes the file and puts
>
> org.eclipse.uml2.uml.internal.impl.InstanceSpecificationImpl@1db60321
> (name: TestContextArtifactInstance, visibility: <unset>)
>
> into it.
>
> I do not know why this suddenly happened and I am grateful for any hint.
>
> Regards,
> Marc-Florian
Re: [Acceleo] Problem with file generation [message #1235412 is a reply to message #1234090] Fri, 24 January 2014 09:30 Go to previous message
Stephane Begaudeau is currently offline Stephane Begaudeau
Messages: 413
Registered: April 2010
Location: Nantes (France)
Senior Member

Hi,

I agree with Ed, you should check the version of the UML2 project that you are using (UML2 3.x, 4.x, 5.x?) and the NsURI of the UML meta-model in the header of your Acceleo module.

While using EObject as the type of your element can be useful for testing, do not even try to consider it as a viable long term solution. If you are not using an Ecore model as the input, it will just create problems for you.

Regards,

Stephane Begaudeau, Obeo

--
Twitter: @sbegaudeau
Google+: +stephane.begaudeau
Blog: http://stephanebegaudeau.tumblr.com | Eclipse Java Development Tools Tips and Tricks



Previous Topic:emtl files not created when the imported projects are not copied in the workspace
Next Topic:[Acceleo] Standalone usage not possible
Goto Forum:
  


Current Time: Mon Oct 20 11:36:50 GMT 2014

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

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