Home » Modeling » VIATRA » Importing Ecore metamodel into Modelspace with VIATRA2 R3.1
Importing Ecore metamodel into Modelspace with VIATRA2 R3.1 [message #645078] |
Wed, 15 December 2010 14:15 |
Tassilo Horn Messages: 93 Registered: July 2009 |
Member |
|
|
Hi all,
I want to do my first VIATRA2 transformation, but I am unable to get my
models imported. I have a source and a target metamodel as Ecore
models, and an EMF model conforming to the source metamodel.
So I've created a new project including a new model space (New > VIATRA2
VPM Model Space). In the wizard, I have included VDM Core and UML, but
I don't know if that's needed.
So what now? How do I import the metamodels from the Ecore files?
The getting started guide
http://wiki.eclipse.org/VIATRA2/GettingStarted/Using_Transfo rmations
only tells me how to import models and mentions the requirement that the
metamodel has to be present in the importing model space. This
requirement is not met for me, and I can neither drag & drop the
metamodel nor a model into my fresh modelspace (or at least, that
doesn't change and I don't get any messages in the VIATRA2 Console).
Maybe that's related: In Preferences > VIATRA2 > UML2 Importer, the
"Ignore specified profiles" option is activated and ecore and Ecore are
in the ignore list. But I don't get any different behavior when
deactivating the option.
Thanks a lot for any hints!
Tassilo
--
Dipl.-Inform. Tassilo Horn | Room: B015
University of Koblenz-Landau, Campus Koblenz | Phone: +49 (261) 287-2745
Institute for Software Technology | Mail: horn@uni-koblenz.de
Universitätsstr. 1, 56070 Koblenz, Germany |
|
|
| |
Re: Importing Ecore metamodel into Modelspace with VIATRA2 R3.1 [message #645235 is a reply to message #645142] |
Thu, 16 December 2010 07:59 |
Tassilo Horn Messages: 93 Registered: July 2009 |
Member |
|
|
Zoltán Ujhelyi <ujhelyiz@mit.bme.hu> writes:
Hi Zoltán,
> If I understand your issue correctly, you are trying to load an
> existing EMF model (but not a UML model) to the model space.
Exactly.
> Such an importer can be downloaded from our external source
> repository. Use the following project:
>
> https://svn.inf.mit.bme.hu/viatra/viatra_extra/R3/mit.bme.hu /trunk/ViatraEMF/code/hu.optxware.emf2viatra.core/
>
> After this project is included, ecore metamodels can be imported using
> drag'n'drop, while the instance models (resources) can be loaded using
> the right click menu.
I've checked that out and imported it into my Eclipse workspace. Then I
did "Run as > Eclipse Application" on that project, and a new Eclipse
instance was started.
In that, I've imported my VIATRA2 project and the two other projects
containing the Ecore metamodels and EMF instances. Dragging and
dropping an Ecore metamodel into my model space produces this error
message in the VIATRA2 Console:
[fatal] Error executing task 'Drag-and-drop operation'
(java.lang.reflect.InvocationTargetException) [null]
In the other eclipse instance, I have a full backtrace in Console:
--8<---------------cut here---------------start------------->8---
!ENTRY VIATRA2 4 1 2010-12-16 08:53:36.182
!MESSAGE Error executing task 'Drag-and-drop operation' (java.lang.reflect.InvocationTargetException) [null]
[fatal] Error executing task 'Drag-and-drop operation' (java.lang.reflect.InvocationTargetException) [null]
java.lang.reflect.InvocationTargetException
at org.eclipse.viatra2.frameworkgui.views.FrameworkDropTargetAd apter$5.run(FrameworkDropTargetAdapter.java:201)
at org.eclipse.jface.operation.ModalContext$ModalContextThread. run(ModalContext.java:121)
Caused by: org.eclipse.viatra2.framework.FrameworkException: Native import ended with error
at org.eclipse.viatra2.framework.Framework.nativeImport(Framewo rk.java:557)
at org.eclipse.viatra2.frameworkgui.views.FrameworkDropTargetAd apter$5.run(FrameworkDropTargetAdapter.java:192)
... 1 more
Caused by: org.eclipse.viatra2.errors.VPMRuntimeException: Error encountered while importing ECore
at hu.optxware.emf2viatra.core.importer.EcoreImporter.processFi le(EcoreImporter.java:107)
at org.eclipse.viatra2.framework.Framework.nativeImport(Framewo rk.java:555)
... 2 more
Caused by: java.lang.NullPointerException
at hu.optxware.emf2viatra.core.managers.EMF2ViatraSynchronizer. getIEntityForEPackage(EMF2ViatraSynchronizer.java:168)
at hu.optxware.emf2viatra.core.managers.EMF2ViatraSynchronizer. getIEntityForEClass(EMF2ViatraSynchronizer.java:127)
at hu.optxware.emf2viatra.core.importer.EcoreImporter.processSu perTypes(EcoreImporter.java:216)
at hu.optxware.emf2viatra.core.importer.EcoreImporter.processFi le(EcoreImporter.java:92)
... 3 more
--8<---------------cut here---------------end--------------->8---
Any idea what's the problem?
As another solution: it's not too hard for me to recreate my metamodels
(and some test instances) as plain UML models using IBM RSA 7.5. Do I
simply need to create a Class Diagram for the metamodel, and a
corresponding Object Diagram for the instance, and then export those to
XMI?
Bye,
Tassilo
--
Dipl.-Inform. Tassilo Horn | Room: B015
University of Koblenz-Landau, Campus Koblenz | Phone: +49 (261) 287-2745
Institute for Software Technology | Mail: horn@uni-koblenz.de
Universitätsstr. 1, 56070 Koblenz, Germany |
|
|
| |
Importing UML2 Metamodel & Model from IBM RSA (was: Importing Ecore metamodel into Modelspace wi [message #645246 is a reply to message #645235] |
Thu, 16 December 2010 09:03 |
Tassilo Horn Messages: 93 Registered: July 2009 |
Member |
|
|
Tassilo Horn <horn@uni-koblenz.de> writes:
Hi again,
> As another solution: it's not too hard for me to recreate my
> metamodels (and some test instances) as plain UML models using IBM RSA
> 7.5. Do I simply need to create a Class Diagram for the metamodel,
> and a corresponding Object Diagram for the instance, and then export
> those to XMI?
Now I've done that and exported my metamodel defined by a class diagram
and my instance defined as object diagram to an UML2.1 model. When I
create a new empty model space and drag & drop (or use the context menu
in the model space view), I get an error that uml.metamodel.uml.Integer
is missing.
So I created another model space that includes VTM Core and UML, and did
the same again. Now the import only issued some warnings, but the
problem is that both the imported classes as well as the imported
instances are placed into the model part of the existing UML metamodel.
For example, my UML class diagram defines a class Member. That shows up
as uml.models.MyProject_uml.mypackage.Member with type
uml.metamodel.uml.Class, and no instances.
But of course, my object diagram has an instance of class Member. That
shows up as uml.models.MyProject_uml.mypackage.Chris, with type
uml.metamodel.uml.InstanceSpecification, but no relation to my Member
class at all.
I had expected that the class diagram is a new metamodel, and my object
diagram is an instance thereof.
So it seems to me that in order to do transformations from instances of
custom metamodels, I have to recreate them using the model space editor.
Is that correct?
Bye,
Tassilo
--
Dipl.-Inform. Tassilo Horn | Room: B015
University of Koblenz-Landau, Campus Koblenz | Phone: +49 (261) 287-2745
Institute for Software Technology | Mail: horn@uni-koblenz.de
Universitätsstr. 1, 56070 Koblenz, Germany |
|
|
| |
Re: Importing UML2 Metamodel & Model from IBM RSA (was: Importing Ecore metamodel into Modelspac [message #645308 is a reply to message #645301] |
Thu, 16 December 2010 14:30 |
Tassilo Horn Messages: 93 Registered: July 2009 |
Member |
|
|
Zoltán Ujhelyi <ujhelyiz@mit.bme.hu> writes:
Hi Zoltán,
> I tested your ecore models, and realized, I forgot to tell the
> important part of using the EMF importer: you have to have an Ecore
> meta-metamodel present in the VPM model space in order to import an
> ecore model (metamodel).
Ah, ok. That makes sense.
> Instead I suggest giving another try to the ecore importer as
> described above.
Now I've already modeled both source and target metamodel, as well as a
source instance in the VDM editor. And my first transformation is also
nearly complete. ;-)
But for the next models, I'll try the ecore approach.
Bye,
Tassilo
--
Dipl.-Inform. Tassilo Horn | Room: B015
University of Koblenz-Landau, Campus Koblenz | Phone: +49 (261) 287-2745
Institute for Software Technology | Mail: horn@uni-koblenz.de
Universitätsstr. 1, 56070 Koblenz, Germany |
|
|
| | |
Goto Forum:
Current Time: Thu Nov 07 01:28:31 GMT 2024
Powered by FUDForum. Page generated in 0.11004 seconds
|