Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » [Acceleo] Use Enterprise Architect models with Acceleo
[Acceleo] Use Enterprise Architect models with Acceleo [message #1012086] Wed, 20 February 2013 21:23 Go to next message
André Ribeiro is currently offline André RibeiroFriend
Messages: 48
Registered: January 2013
Member
Hi everyone,

I've been trying to use models created with Enterprise Architect (exported as XMI) with Acceleo, but unfortunately when I try to generate code the following message is displayed:

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.


I've tried with Papyrus (.uml file) and everything worked fine.
I don't know if the problem is caused by the metamodel URI.

Thanks in advance.


André Ribeiro
IST Lisbon
Portugal
Re: [Acceleo] Use Enterprise Architect models with Acceleo [message #1012275 is a reply to message #1012086] Thu, 21 February 2013 08:55 Go to previous messageGo to next message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1638
Registered: July 2009
Senior Member
André,

This is most likely due to the metamodel URI. Papyrus uses the MDT/UML2 project directly, much as you probably did; the URI you've used as a target of your generation (at the top of your mtl file) is surely looking like this:
http://www.eclipse.org/uml2/3.0.0/UML
. That is also the metamodel used by Papyrus, so the generation's "target" matched the Papyrus export.

However, the file you provide here uses this as its metamodel:
http://schema.omg.org/spec/UML/2.0
. This will not match your module's target. You can either change the NsURI you use in the module (the elements should match, more or less, what you already use), or look into migration facilities the UML2 project may provide, I am not familiar with it.

Laurent Goubet
Obeo
Re: [Acceleo] Use Enterprise Architect models with Acceleo [message #1012397 is a reply to message #1012275] Thu, 21 February 2013 13:41 Go to previous messageGo to next message
André Ribeiro is currently offline André RibeiroFriend
Messages: 48
Registered: January 2013
Member
Thanks for the answer Laurent.

I've done the following tests:

1- Changed the file extension from .xml to .xmi and the previous error disappeared, but a new one arose:
An internal error occurred during: "Launching Generate (1)".
org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri 'http://schema.omg.org/spec/XMI/2.1' not found.


2- Replaced the URI 'http://schema.omg.org/spec/UML/2.0' to 'http://www.eclipse.org/uml2/2.1.0/UML' and changed the file extension to .uml. The following error appeared:
An internal error occurred during: "Launching Generate (1)".
org.eclipse.emf.ecore.xmi.IllegalValueException: Value 'org.eclipse.uml2.uml.internal.impl.PackageImpl@17ae8e0 (name: Model, visibility: <unset>) (URI: null)' is not legal.


3- Changed the file extension to .xmi, replaced the xmi URI 'http://schema.omg.org/spec/XMI/2.1' to 'http://www.omg.org/spec/XMI/20110701' and xmi:version from '2.1' to '20110701' without success:
An internal error occurred during: "Launching Generate (1)".
org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri 'http://www.omg.org/spec/XMI/20110701' not found.


In your website it's written that Acceleo is compatible with Sparx Enterprise Architect 7.1 build 830 and I'm using the version 7.5.844 build 844.

Could you please provide me a simple example that works?

Thank you.


André Ribeiro
IST Lisbon
Portugal
Re: [Acceleo] Use Enterprise Architect models with Acceleo [message #1012801 is a reply to message #1012397] Fri, 22 February 2013 08:47 Go to previous messageGo to next message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1638
Registered: July 2009
Senior Member
André,

André Ribeiro wrote on Thu, 21 February 2013 08:41

In your website it's written that Acceleo is compatible with Sparx Enterprise Architect 7.1 build 830 and I'm using the version 7.5.844 build 844.


The website you've seen this on is for Acceleo 2, not Acceleo 3. Acceleo 3 is "compatible with EA" as long as you export as an "EMF" model (I don't remember how this was done in EA). This is what you seem to have done.

For all of the following, please make sure that you have installed UML2 in your eclipse :
- Help > Install New Software...
- Select the update site corresponding to your current eclipse (Helios, Indigo, Juno, Kepler...)
- locate Modeling / UML2 Extender SDK and install it.

André Ribeiro wrote on Thu, 21 February 2013 08:41

1- Changed the file extension from .xml to .xmi and the previous error disappeared, but a new one arose:
An internal error occurred during: "Launching Generate (1)".
org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri 'http://schema.omg.org/spec/XMI/2.1' not found.



The extension you should have used is ".uml", as this is what will allow the UML2 project to 'see' that your model is an UML model, and that it should try and convert it to its own format.

This alone might be enough to fix your issue.

André Ribeiro wrote on Thu, 21 February 2013 08:41

2- Replaced the URI 'http://schema.omg.org/spec/UML/2.0' to 'http://www.eclipse.org/uml2/2.1.0/UML' and changed the file extension to .uml. The following error appeared:
An internal error occurred during: "Launching Generate (1)".
org.eclipse.emf.ecore.xmi.IllegalValueException: Value 'org.eclipse.uml2.uml.internal.impl.PackageImpl@17ae8e0 (name: Model, visibility: <unset>) (URI: null)' is not legal.



Leave the URI as-is. Only change the extension. The URI defines the "schema" of your model; and what's valid for http://schema.omg.org/spec/UML/2.0 is not for http://www.eclipse.org/uml2/2.1.0/UML . The UML2 project will do the conversion work for you transparently.

Laurent Goubet
Obeo
Re: [Acceleo] Use Enterprise Architect models with Acceleo [message #1013368 is a reply to message #1012801] Sat, 23 February 2013 13:22 Go to previous messageGo to next message
André Ribeiro is currently offline André RibeiroFriend
Messages: 48
Registered: January 2013
Member
Hi Laurent,

Once again thanks for the answer.
I've done what you said and I still get the "generation failed..." warning.


André Ribeiro
IST Lisbon
Portugal
Re: [Acceleo] Use Enterprise Architect models with Acceleo [message #1013371 is a reply to message #1013368] Sat, 23 February 2013 13:30 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 4154
Registered: July 2009
Senior Member
Hi

Make sure that you can open your files and browse usefully with the UML
Model Editor before attempting to use them in a more challenging model
transformation tool context.

Regards

Ed Willink

On 23/02/2013 13:22, André Ribeiro wrote:
> Hi Laurent,
>
> Once again thanks for the answer.
> I've done what you said and I still get the "generation failed..."
> warning.
Re: [Acceleo] Use Enterprise Architect models with Acceleo [message #1013381 is a reply to message #1013371] Sat, 23 February 2013 14:19 Go to previous messageGo to next message
André Ribeiro is currently offline André RibeiroFriend
Messages: 48
Registered: January 2013
Member
Hi Ed,

I can open the file with the UML Model Editor:
index.php/fa/13526/0/

The files 'DummyEA.uml' and 'DummyModel.uml' are the .xmi that I've exported from Enterprise Architect, while 'MyDummy.uml' was created in Eclipse:
index.php/fa/13527/0/

I'm also using the following code template:
[comment encoding = UTF-8 /]
[module generate('http://www.eclipse.org/uml2/2.0.0/UML')]

[template public generateElement(model : Model)]
[comment @main /]

[file ('asd.java', false, 'UTF-8')]
[model.name/]
[/file]

[/template]


Thanks.
  • Attachment: DummyModel.PNG
    (Size: 31.06KB, Downloaded 778 times)
  • Attachment: project.PNG
    (Size: 4.41KB, Downloaded 700 times)


André Ribeiro
IST Lisbon
Portugal
Re: [Acceleo] Use Enterprise Architect models with Acceleo [message #1013389 is a reply to message #1013381] Sat, 23 February 2013 14:52 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 4154
Registered: July 2009
Senior Member
Hi

That doesn't look like a successfully opened UML model.

It is full of text annotations.

It looks like it's fallen back to reflective XML.

Use the declarations in MyDummy.uml to fix up DummyModel.uml using a
text editor.

Regards

Ed Willink


On 23/02/2013 14:19, André Ribeiro wrote:
> Hi Ed,
>
> I can open the file with the UML Model Editor:
>
>
> The files 'DummyEA.uml' and 'DummyModel.uml' are the .xmi that I've exported from Enterprise Architect, while 'MyDummy.uml' was created in Eclipse:
>
>
> I'm also using the following code template:
> [comment encoding = UTF-8 /]
> [module generate('http://www.eclipse.org/uml2/2.0.0/UML')]
>
> [template public generateElement(model : Model)]
> [comment @main /]
>
> [file ('asd.java', false, 'UTF-8')]
> [model.name/]
> [/file]
>
> [/template]
>
> Thanks.
Re: [Acceleo] Use Enterprise Architect models with Acceleo [message #1013397 is a reply to message #1012801] Sat, 23 February 2013 15:12 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 4154
Registered: July 2009
Senior Member
Hi

http://schema.omg.org/spec/UML/2.0 is for UML 2.0 which is older than
the MDT/UML2 project which supports at 2.1, 2.1.1, 2.2, 2.4, 2.4.1; you
must use one of those with a *.xmi extension. Or one of the MDT/UML2
URIs with a *.uml extension.

The 2.4, 2.4.1 support is only available in Indigo.

If using 2.4, 2.4.1 your packages should have URIs.

Regards

Ed Willink


On 22/02/2013 08:47, Laurent Goubet wrote:
> Leave the URI as-is. Only change the extension. The URI defines the
> "schema" of your model; and what's valid for
> http://schema.omg.org/spec/UML/2.0 is not for
> http://www.eclipse.org/uml2/2.1.0/UML . The UML2 project will do the
> conversion work for you transparently.
Re: [Acceleo] Use Enterprise Architect models with Acceleo [message #1013419 is a reply to message #1013397] Sat, 23 February 2013 16:08 Go to previous messageGo to next message
André Ribeiro is currently offline André RibeiroFriend
Messages: 48
Registered: January 2013
Member
Thanks for the help Ed.
So basically you're saying that I have to export the .xmi of a UML 2.1 or greater diagram and use in Eclipse with that extension, right?


André Ribeiro
IST Lisbon
Portugal
Re: [Acceleo] Use Enterprise Architect models with Acceleo [message #1014203 is a reply to message #1013419] Mon, 25 February 2013 11:11 Go to previous messageGo to next message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1638
Registered: July 2009
Senior Member
André,

I rarely, if ever, use UML; Ed should be a lot more help on that aspect. However the screenshot you've pasted here indeed does not look like a successful opening of the UML editor. You might want to ask these questions on the UML forum with a copy of your dummy "exported" UML model, and the version of Enterprise Architect it is coming from in case they have used it.

They should be able to tell you exactly what your missing, what they support... or at least what's preventing UML2 to open your particular model.

Laurent Goubet
Obeo
Re: [Acceleo] Use Enterprise Architect models with Acceleo [message #1014228 is a reply to message #1014203] Mon, 25 February 2013 12:02 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 4154
Registered: July 2009
Senior Member
Hi Laurent

A problem for UML users with almost all the Eclipse model transformation
tools is the lack of a good UML example that can be seen to work and
used as a reference for the user's problem models.

In the case of Acceleo, the comments in the auto-generated main Java
file use UML as the example of a manual package registry contribution,
however my knowledge of the UML initialization complexities make me very
suspicious that this has ever been tested. I would have expected to see
a call to UMLResourcesUtil.init() and possibly some magic heuristics to
try to set the Pathmap uri-mappings correctly. The enhanced EcorePlugin
has the required functionality to compute the classpath variables so
magic heuristics are no longer required. Hopefully UML will require
another init routine that computes the Pathmap URIs too.

Providing misleading example code is unhelpful for users and a little
frustrating for me, since I see this endless stream of puzzled UML
users. I contributed UMLResourcesUtil.init() to solve 95% of the
problems, but the remaining 5% is still a really hard problem that users
shouldn't need to know about until they choose to become experts.

I'll see if I can chase up/do the missing 5%.

Regards

Ed Willink



On 25/02/2013 11:11, Laurent Goubet wrote:
> André,
>
> I rarely, if ever, use UML; Ed should be a lot more help on that
> aspect. However the screenshot you've pasted here indeed does not look
> like a successful opening of the UML editor. You might want to ask
> these questions on the http://www.eclipse.org/forums/index.php/f/117/
> with a copy of your dummy "exported" UML model, and the version of
> Enterprise Architect it is coming from in case they have used it.
>
> They should be able to tell you exactly what your missing, what they
> support... or at least what's preventing UML2 to open your particular
> model.
>
> Laurent Goubet
> Obeo
Re: [Acceleo] Use Enterprise Architect models with Acceleo [message #1014234 is a reply to message #1014228] Mon, 25 February 2013 12:17 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 4154
Registered: July 2009
Senior Member
Hi

https://bugs.eclipse.org/bugs/show_bug.cgi?id=401682 raised.

Regards

Ed Willink

On 25/02/2013 12:02, Ed Willink wrote:
> I'll see if I can chase up/do the missing 5%.
Re: [Acceleo] Use Enterprise Architect models with Acceleo [message #1014343 is a reply to message #1014234] Mon, 25 February 2013 16:18 Go to previous messageGo to next message
André Ribeiro is currently offline André RibeiroFriend
Messages: 48
Registered: January 2013
Member
Hi,

Thanks for the clarifications, Ed and Laurent, but I still have the question:
Is there a way I can load a XMI from Enterprise Architect into Eclipse?

Very grateful for your help.


André Ribeiro
IST Lisbon
Portugal
Re: [Acceleo] Use Enterprise Architect models with Acceleo [message #1014383 is a reply to message #1014343] Mon, 25 February 2013 17:50 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 6499
Registered: July 2009
Senior Member
Hi you may have a look at http://www.yakindu.com/eabridge/

--
Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext at itemis dot de
Re: [Acceleo] Use Enterprise Architect models with Acceleo [message #1014843 is a reply to message #1014383] Tue, 26 February 2013 15:14 Go to previous messageGo to next message
André Ribeiro is currently offline André RibeiroFriend
Messages: 48
Registered: January 2013
Member
Hi Christian,

Thanks for your answer.
I've already looked at YAKINDU EA-UML-Bridge's page, but I could not find the download page.
Probably, it's proprietary.


André Ribeiro
IST Lisbon
Portugal
Re: [Acceleo] Use Enterprise Architect models with Acceleo [message #1014899 is a reply to message #1014843] Tue, 26 February 2013 17:18 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 6499
Registered: July 2009
Senior Member
Yes it is.

--
Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext at itemis dot de
Re: [Acceleo] Use Enterprise Architect models with Acceleo [message #1015109 is a reply to message #1014899] Wed, 27 February 2013 13:31 Go to previous messageGo to next message
André Ribeiro is currently offline André RibeiroFriend
Messages: 48
Registered: January 2013
Member
Hi Christian,

I needed this for academic purpose (my MSc project).
Is there any chance I can get a low cost license or is there any other tool you recommend?

Thanks.


André Ribeiro
IST Lisbon
Portugal
Re: [Acceleo] Use Enterprise Architect models with Acceleo [message #1015379 is a reply to message #1015109] Thu, 28 February 2013 12:35 Go to previous messageGo to next message
Eclipse UserFriend
Hi André,

this information is indeed still missing on our website.

The Yakindu EA-Bridge is not (yet) available for public download, but
you may request a trial version for one month or an academic license for
one year.
If you would like to get an academic license, please send a request with
a brief description what you want to do with it (e.g. a few words about
your master thesis) and a copy of your student ID to:
bridges at yakindu dot com


Best regards
Patrick

Am 27.02.2013 14:31, schrieb André Ribeiro:
> Hi Christian,
>
> I needed this for academic purpose (my MSc project).
> Is there any chance I can get a low cost license or is there any other
> tool you recommend?
>
> Thanks.
Re: [Acceleo] Use Enterprise Architect models with Acceleo [message #1015646 is a reply to message #1015379] Fri, 01 March 2013 14:07 Go to previous messageGo to next message
André Ribeiro is currently offline André RibeiroFriend
Messages: 48
Registered: January 2013
Member
Ok, thanks for the information Patrick.

André Ribeiro
IST Lisbon
Portugal
Re: [Acceleo] Use Enterprise Architect models with Acceleo [message #1023908 is a reply to message #1012086] Mon, 25 March 2013 12:46 Go to previous messageGo to next message
Christine Niebler is currently offline Christine NieblerFriend
Messages: 1
Registered: March 2013
Junior Member
Hello together,

I seem to have the same problem as André. Unfortunately, I do not have the option to fall back to a proprietary solution.

Am not a XML expert, but it seems to me as if the UML models that are created within EMF are not stored in any standard XMI format.
So I assume, it would not be so hard to write a XSLT transformation from the XMI exported by Enterprise Architect to the XML format expected by Acceleo/EMF - unless I knew the expected format. Is there a schema definition available? I searched quite long for it, but without success.

An alternative might be to write my own model importer, similar to the Rose Model importer, but I guess, my problems won't get easier with that approach.

Any help is greatly appreciated.

@André: nevertheless, it would be interesting, how your experience is with YAKINDU EA-UML-Bridge. Any success with that?

Best Regards,
Christine
Re: [Acceleo] Use Enterprise Architect models with Acceleo [message #1027940 is a reply to message #1023908] Wed, 27 March 2013 16:18 Go to previous messageGo to next message
André Ribeiro is currently offline André RibeiroFriend
Messages: 48
Registered: January 2013
Member
Hi Christine,

I postponed the integration with EA.
For now, I'm using Papyrus Diagrams to develop my project, but in the near future I would like to support XMI.


André Ribeiro
IST Lisbon
Portugal
Re: [Acceleo] Use Enterprise Architect models with Acceleo [message #1066978 is a reply to message #1027940] Fri, 05 July 2013 10:26 Go to previous messageGo to next message
André Ribeiro is currently offline André RibeiroFriend
Messages: 48
Registered: January 2013
Member
For those who could be interested, I've tested a trial version of YAKINDU EA-UML-Bridge with success. I was able to open and edit EA models in Eclipse.

André Ribeiro
IST Lisbon
Portugal
Re: [Acceleo] Use Enterprise Architect models with Acceleo [message #1436707 is a reply to message #1012086] Fri, 03 October 2014 09:34 Go to previous message
Vince Vince is currently offline Vince VinceFriend
Messages: 1
Registered: October 2014
Junior Member
I use Eclipse Luna and Acceleo 3.5. Acceleo is compatible with Enterprise Archiect (It's write on web site). I don't understand why we have a lot of difficulties to use EA with Acceleo. What is the procedure recommended by Acceleo to use Enterprise Architect. It is really compatible.
Previous Topic:[Acceleo] Create a new Acceleo Generation Project fails to create project
Next Topic:acceleo : stereotype value and generated files layout
Goto Forum:
  


Current Time: Fri Nov 28 09:00:38 GMT 2014

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

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