Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » [Acceleo] The generation fail to generate any file because there are no model elements that matches
[Acceleo] The generation fail to generate any file because there are no model elements that matches [message #784240] Fri, 27 January 2012 08:39 Go to next message
D O is currently offline D OFriend
Messages: 13
Registered: November 2011
Junior Member
Hi,

I am an old user of Acceleo (v2.x). But I have a little experience of version 3.x using UML model as source.

I try to experiment Acceleo with another metamodel: without success.

The response of the generation process is:
"The generation fail 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."

the source model is a XMI file with the metamodel 'www.eclipse.org/ocl/1.1.0/Ecore' resulting from the serialization of an OCL expression.

The Acceleo version used is 3.1.1.v20110914-0246
Eclipse version 3.7.1

What should I look to resolve this issue?

Best regards
Re: [Acceleo] The generation fail to generate any file because there are no model elements that matc [message #787150 is a reply to message #784240] Tue, 31 January 2012 08:12 Go to previous messageGo to next message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1902
Registered: July 2009
Senior Member
Hi,

These error message indicate that you tried to launch a generation on a model which does not contain any element that can be used as target of your main template. For example if you used Ecore as metamodel, and your main template looks like this :

[template public main(anEClass : EClass)]
[comment @main/]
[file ...]
...
[/file]
[/template]


Then you should have at least one "EClass" in the model you feed to Acceleo.


However, the "metamodel" you indicate here, "www.eclipse.org/ocl/1.1.0/Ecore" (which seems to be missing its leading "http" btw), is probably not what you should be using. What exactly are you trying to generate, with which metamodel?

Laurent Goubet
Obeo.
Re: [Acceleo] The generation fail to generate any file because there are no model elements that matc [message #787361 is a reply to message #787150] Tue, 31 January 2012 13:55 Go to previous messageGo to next message
D O is currently offline D OFriend
Messages: 13
Registered: November 2011
Junior Member
Thank you for your response.

The input model is a XMI file with the metamodel 'www.eclipse.org/ocl/1.1.0/Ecore' resulting from the serialization of an OCL expression.

In attachments, you will find all the resources.
  • Attachment: main.mtl
    (Size: 0.29KB, Downloaded 223 times)
  • Attachment: generate.mtl
    (Size: 0.25KB, Downloaded 245 times)
  • Attachment: ECT01.ocl.ecore
    (Size: 25.97KB, Downloaded 287 times)
Re: [Acceleo] The generation fail to generate any file because there are no model elements that matc [message #787382 is a reply to message #787361] Tue, 31 January 2012 14:11 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
HI D O

You may need to be aware of
https://bugs.eclipse.org/bugs/show_bug.cgi?id=345708 that prevents me as
an OCL developer using Acceleo when I have the ...ocl.ecore plugin open
in the workspace. The ...ocl.ecore plugin defines the
www.eclipse.org/ocl/1.1.0/Ecore model, so you may well have that plugin
open.

[If you are happy with experimental software, you might prefer to use
the prototype 'OCL 2.5' implementation in Pivot.ecore in the Examples
plugins. This is approximately UML aligned with modeled library
operations permitting all references to be persisted in XMI. Using
Pivot.ecore rather than Ecore.ecore avoids the Acceleo conflict between
www.eclipse.org/ocl/1.1.0/Ecore as a user and as built-in tool support.
You will Acceleo templates that generate Java code from OCL embedded in
Ecore models.]

Regards

Ed Willink

On 31/01/2012 13:55, D O wrote:
> Thank you for your response.
>
> The input model is a XMI file with the metamodel 'www.eclipse.org/ocl/1.1.0/Ecore' resulting from the serialization of an OCL expression.
>
> In attachments, you will find all the resources.
>
Re: [Acceleo] The generation fail to generate any file because there are no model elements that matc [message #787432 is a reply to message #787382] Tue, 31 January 2012 15:20 Go to previous messageGo to next message
D O is currently offline D OFriend
Messages: 13
Registered: November 2011
Junior Member
Want to talk about what www.eclipse.org/ocl/3.1.0/Pivot metamodel (present in the org.eclise.ocl plugin version 3.1)?

If so, you know how to use this version for creating an XMI file?

Best.

DO
Re: [Acceleo] The generation fail to generate any file because there are no model elements that matc [message #787456 is a reply to message #787432] Tue, 31 January 2012 15:50 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

You will broadly similar Java APIs in org.eclipse.ocl.examples.pivot to
org.eclipse.ocl.ecore.

Additionally there are Xtext editors and code generators.

You can find examples of most things in the
org.eclipse.ocl.examples.xtext.tests plugin.

Regards

Ed Willink

On 31/01/2012 15:20, D O wrote:
> Want to talk about what www.eclipse.org/ocl/3.1.0/Pivot metamodel
> (present in the org.eclise.ocl plugin version 3.1)?
>
> If so, you know how to use this version for creating an XMI file?
>
> Best.
>
> DO
Re: [Acceleo] The generation fail to generate any file because there are no model elements that matc [message #788843 is a reply to message #787456] Thu, 02 February 2012 09:37 Go to previous messageGo to next message
D O is currently offline D OFriend
Messages: 13
Registered: November 2011
Junior Member
Dear Ed,

I looked at the XText console example using the metamodel Pivot.

I changed my example to use the imports Pivot objects. But I have a problem to adapt the UML objects into Pivot objects.

Can you tell me how to make this adaptation as efficiently as possible?

Thanks in advance.

DO
Re: [Acceleo] The generation fail to generate any file because there are no model elements that matc [message #788864 is a reply to message #788843] Thu, 02 February 2012 09:55 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

Please continue this thread with a new title on the OCL newsgroup.

You should find that UML objects are automatically converted to Ecore
and then to Pivot by UML2Pivot, but since I have little idea what you're
doing I can't comment further.

Regards

Ed Willink

On 02/02/2012 09:37, D O wrote:
> Dear Ed,
>
> I looked at the XText console example using the metamodel Pivot.
>
> I changed my example to use the imports Pivot objects. But I have a
> problem to adapt the UML objects into Pivot objects.
>
> Can you tell me how to make this adaptation as efficiently as possible?
>
> Thanks in advance.
>
> DO
Previous Topic:is there a way to generate a project
Next Topic:Using Acceleo investigating a model
Goto Forum:
  


Current Time: Tue Mar 19 09:31:33 GMT 2024

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

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

Back to the top