[Acceleo] Use Enterprise Architect models with Acceleo [message #1012086] |
Wed, 20 February 2013 16:23  |
Eclipse User |
|
|
|
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.
|
|
|
|
|
Re: [Acceleo] Use Enterprise Architect models with Acceleo [message #1012801 is a reply to message #1012397] |
Fri, 22 February 2013 03:47   |
Eclipse User |
|
|
|
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 #1014228 is a reply to message #1014203] |
Mon, 25 February 2013 07:02   |
Eclipse User |
|
|
|
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 #1023908 is a reply to message #1012086] |
Mon, 25 March 2013 08:46   |
Eclipse User |
|
|
|
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
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.35882 seconds