Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » VIATRA2 » Stereotypes not shown in modelspace
Stereotypes not shown in modelspace [message #868901] Wed, 02 May 2012 13:59 Go to next message
Cristina Murillo is currently offline Cristina Murillo
Messages: 25
Registered: December 2011
Junior Member
Hi,

I am trying to import a UML model into Viatra's modelspace. The import is done correctly, however, I have applied stereotypes inside my UML model, and specified values to properties, but this information is not available in the modelspace.

Are stereotypes and properties supported by the UML importer?

I appreciate your answers!

Thank you,
Cristina

Re: Stereotypes not shown in modelspace [message #869321 is a reply to message #868901] Thu, 03 May 2012 04:23 Go to previous messageGo to next message
Abel Hegedus is currently offline Abel Hegedus
Messages: 88
Registered: July 2009
Member
Hi,

the UML importer of VIATRA2 supports stereotypes and properties.

If you follow the instructions for importing UML2 as described here: (eclipse wiki)/VIATRA2/UseCases/ModelExportImport, you should have your model and the applied profile imported under uml2.models.

The stereotype applications are represented using an "Extension" elements found under the imported "profile".

Unfortunately, from my experience with a small Papyrus model imported now, there is no relation from the Extension element to the original Class, instead there is a reference to a "base_Class" Property put into the Stereotype. I believe that the importer erroneously creates this instead of pointing to the Class. Also, it seems the Property values are not properly imported either.

We will look into the matter, however, it would be really helpful if you could send us a small example that we can use to reproduce the issue and offer further assistance.
Re: Stereotypes not shown in modelspace [message #869466 is a reply to message #869321] Thu, 03 May 2012 08:47 Go to previous messageGo to next message
Cristina Murillo is currently offline Cristina Murillo
Messages: 25
Registered: December 2011
Junior Member
Hi,

Thank you for your reply. I created a simple example to show you the issue I have. I applied a profile, and then created a class diagram, which only has one class called Example, and applied the stereotype <<daServiceRequest>>, set the property of this stereotype, accessProb to 10. I attach the resulting uml file generated using Papyrus.

I am really interested in importing such an UML model into VIATRA's modelspace, so please let me know if I can provide more examples, or anything else I can do.

Thank you,
Cristina
  • Attachment: example.uml
    (Size: 2.71KB, Downloaded 200 times)
Re: Stereotypes not shown in modelspace [message #869495 is a reply to message #869466] Thu, 03 May 2012 09:31 Go to previous messageGo to next message
Abel Hegedus is currently offline Abel Hegedus
Messages: 88
Registered: July 2009
Member
Thank you for the example file! Please also attach the DAM.profile.uml file as well, as it is referenced from the model.
Re: Stereotypes not shown in modelspace [message #869518 is a reply to message #869495] Thu, 03 May 2012 10:21 Go to previous messageGo to next message
Cristina Murillo is currently offline Cristina Murillo
Messages: 25
Registered: December 2011
Junior Member
Hi,

Sorry! Here it is!

Thank you
Re: Stereotypes not shown in modelspace [message #869619 is a reply to message #869518] Thu, 03 May 2012 14:03 Go to previous messageGo to next message
Abel Hegedus is currently offline Abel Hegedus
Messages: 88
Registered: July 2009
Member
I have managed to track down the missing part of the implementation and fixed the importer to be able to handle applied stereotypes (r6162 on SVN).

Update:
- If you installed VIATRA2 from the nightly update site, you should be able to get the newest version with a "Check for updates".
- If you checked out VIATRA2 from SVN, you can update the {VIATRA2}.uml2.galileo project to get the new version.

Metamodel changes:
- First of all, you will have to create a new VPML model space after you updated your VIATRA2, since the UML metamodel changed. Alternatively, you can use the (viatra.inf.mit.bme.hu)/svn/core/trunk/org.eclipse.viatra2.imports.uml2.galileo/model/uml2_stereotype.vtml and just drag it on your modelspace (in the modelspace view) to add the required metamodel additions to an existing modelspace.

Model import:
- After importing you UML model (with the UML 2.2 native importer), you should now see an "appliedStereotype" relation in the class with a "Stereotype" entity as target.
- Furthermore, the properties are stored in "StereotypeValue" entities inside the class, with both the name and the value stored in (UML)String entities and also a relation to the defining "Stereotype".

If you have any trouble following these instructions, just ask Smile
Re: Stereotypes not shown in modelspace [message #870344 is a reply to message #869619] Mon, 07 May 2012 13:30 Go to previous messageGo to next message
Cristina Murillo is currently offline Cristina Murillo
Messages: 25
Registered: December 2011
Junior Member
Hi,

Thank you for your reply and instructions. I have been trying to get it working but I didn't succeed yet.

I have installed viatra from this site: download.eclipse.org/modeling/gmt/viatra2/update/

But then I thought that was not updated, so I decided to go with the nightly update site as you suggested, so I installed it from scratch, using the ""Install New Software" feature, from this site: viatra.inf.mit.bme.hu/update/nightly

After installing again I did this steps:

1. Create a new VPM model space.
2. Import DAM.profile.uml
3. Import example.uml

Then I checked on the modelspace, but I still can't see the stereotypes, perhaps I am missing something?

Thank you,
Cristina




Re: Stereotypes not shown in modelspace [message #870347 is a reply to message #870344] Mon, 07 May 2012 13:45 Go to previous messageGo to next message
Abel Hegedus is currently offline Abel Hegedus
Messages: 88
Registered: July 2009
Member
Hi,

you can skip the import of the profile, it will do that automatically, when you import example.uml.

Once imported, you should see something like the following under uml.models:

  • example

    • model

      • profileApplication -> Profile
      • ...

        • SomeClass : Class

          • appliedStereotype -> SomeSt
          • stereotypeValue -> StV
          • StV : StereotypeValue

            • name -> prop1
            • value -> someValue

    • profile

      • DAM: Profile

        • ...

          • SomeSt: Stereotype





If this is not the case, can you please list the version of the org.eclipse.viatra2.importers.uml2.galileo plugin from Help -> About -> Installation details -> Plugins.

You can also attach the vpml file with example.uml imported.
Re: Stereotypes not shown in modelspace [message #870354 is a reply to message #870347] Mon, 07 May 2012 14:25 Go to previous messageGo to next message
Cristina Murillo is currently offline Cristina Murillo
Messages: 25
Registered: December 2011
Junior Member
Hi,

I tried updating again but I got the same results, I believe it must be an issue with the version I am getting.

I attach the following files:

1. A screenshot of the version I have installed.
2. A screenshot of the installation which shows the link I am using to install viatra and the options available.
3. The resulting vpml.
4. A text file where I collected an error I get when I select all the options available in 2. Mostly problems with the EMF model, which I disabled in order to proceed with the installation.

Thank you for your help! Smile

Regards,
Cristina
Re: Stereotypes not shown in modelspace [message #870430 is a reply to message #868901] Tue, 08 May 2012 03:12 Go to previous messageGo to next message
Abel Hegedus is currently offline Abel Hegedus
Messages: 88
Registered: July 2009
Member
Hi,

I have attached the VPML as it should be after a successful import. I have deleted the "example_uml" subtree from under uml.models and used the UML 2.2 native importer from the VIATRA2 model spaces view.

Since I managed to import using the same VPML file, it means that you are using the updated metamodel, which is only possible, if you are using the updated importer as well. That might mean that either or other software versions are different (Eclipse, UML, etc.) or the model structure is different.

For comparison, in the workspace, where I'm testing, I have the DAM project imported from the file you sent. Then, I have an other project, that contains the example.uml in it's root (important, since it refers to DAM with ../DAM/DAM.profile.uml relative path).

I would say that if you can open the model in the "UML Model Editor" with the profiles properly loaded, that would imply that the importer is able to load them as well.

Finally, I'm running Eclipse 3.7.2 on Java 1.7 x64, Windows 7 x64 Professional. Also, it is a classic Eclipse, not Modelling, but with EMF SDK and UML Extender SDK installed, among others.

Please post what the importer writes to the log, can do this by opening the VIATRA2 Console view.and copy-pasting the contents. Note that you may have to switch to this view before the import to initialize it.
  • Attachment: TEST.vpml
    (Size: 1.66MB, Downloaded 230 times)
Re: Stereotypes not shown in modelspace [message #870456 is a reply to message #870430] Tue, 08 May 2012 06:28 Go to previous messageGo to next message
Cristina Murillo is currently offline Cristina Murillo
Messages: 25
Registered: December 2011
Junior Member
Hi,

The error I get is the following:

[info] VIATRA2 Console open for model space 'modelSpace6'; issue listcommands() to see available commands.
[info] Trigger engine: Receiver cleared.
[warning] [UML2 importer] ignoring profiles...
[warning] [UML2 importer] NOT ignoring and importing reference: model
[fatal] Error while importing UML model: null
[info] Trigger engine: A transactional operation ended in the system.
[info] Native import lasted for 67 ms[/size]


It is weird, since I am using the same files I attached here for you. I added the DAM profile in the Project References inside the properties of the project where I have the example.uml file in the root.

I do not even get the UMLPrimitiveTypes inside models.example_uml.

Thank you for your help,
Cristina


[Updated on: Tue, 08 May 2012 06:30]

Report message to a moderator

Re: Stereotypes not shown in modelspace [message #870465 is a reply to message #870456] Tue, 08 May 2012 07:07 Go to previous messageGo to next message
Cristina Murillo is currently offline Cristina Murillo
Messages: 25
Registered: December 2011
Junior Member
Hi,

I installed Eclipse classic and viatra from the nightly website, and the profiles are still ignored, the log changed a bit:


[info] VIATRA2 Console open for model space 'modelSpace2'; issue listcommands() to see available commands.
[info] Textual Output View buffer for framework modelSpace2 initialized.
[info] Trigger engine: Receiver cleared.
[info] Trigger engine: A transactional operation ended in the system.
[info] Trigger engine: Receiver cleared.
[warning] [UML2 importer] ignoring profiles...
[warning] [UML2 importer] NOT ignoring and importing reference: model
[debug] [UML2 importer] Found an invalid reference for uml.models.example_uml.model.uN607_76 of type uml.metamodel.uml.Relationship.relatedElement pointing to outside resource: null
[debug] [UML2 importer] Found an invalid reference for uml.models.example_uml.model.uN607_76 of type uml.metamodel.uml.DirectedRelationship.target pointing to outside resource: null
[debug] [UML2 importer] Found an invalid reference for uml.models.example_uml.model.uN607_76 of type uml.metamodel.uml.ProfileApplication.appliedProfile pointing to outside resource: null
[debug] [UML2 importer] Found an invalid reference for uml.models.example_uml.model.uN609_76 of type uml.metamodel.uml.Relationship.relatedElement pointing to outside resource: null
[debug] [UML2 importer] Found an invalid reference for uml.models.example_uml.model.uN609_76 of type uml.metamodel.uml.DirectedRelationship.target pointing to outside resource: null
[debug] [UML2 importer] Found an invalid reference for uml.models.example_uml.model.uN609_76 of type uml.metamodel.uml.ProfileApplication.appliedProfile pointing to outside resource: null
[debug] [UML2 importer] Found an invalid reference for uml.models.example_uml.model.uN611_76 of type uml.metamodel.uml.Relationship.relatedElement pointing to outside resource: null
[debug] [UML2 importer] Found an invalid reference for uml.models.example_uml.model.uN611_76 of type uml.metamodel.uml.DirectedRelationship.target pointing to outside resource: null
[debug] [UML2 importer] Found an invalid reference for uml.models.example_uml.model.uN611_76 of type uml.metamodel.uml.ProfileApplication.appliedProfile pointing to outside resource: null
[debug] [UML2 importer] Found an invalid reference for uml.models.example_uml.model.uN613_76 of type uml.metamodel.uml.Relationship.relatedElement pointing to outside resource: null
[debug] [UML2 importer] Found an invalid reference for uml.models.example_uml.model.uN613_76 of type uml.metamodel.uml.DirectedRelationship.target pointing to outside resource: null
[debug] [UML2 importer] Found an invalid reference for uml.models.example_uml.model.uN613_76 of type uml.metamodel.uml.ProfileApplication.appliedProfile pointing to outside resource: null
[debug] [UML2 importer] Found an invalid reference for uml.models.example_uml.model.uN615_76 of type uml.metamodel.uml.Relationship.relatedElement pointing to outside resource: null
[debug] [UML2 importer] Found an invalid reference for uml.models.example_uml.model.uN615_76 of type uml.metamodel.uml.DirectedRelationship.target pointing to outside resource: null
[debug] [UML2 importer] Found an invalid reference for uml.models.example_uml.model.uN615_76 of type uml.metamodel.uml.ProfileApplication.appliedProfile pointing to outside resource: null
[info] Trigger engine: A transactional operation ended in the system.
[info] Native import using 'org.eclipse.viatra2.uml2.galileo.modelimporter' lasted for 345 ms


Regards,
Cristina
Re: Stereotypes not shown in modelspace [message #870507 is a reply to message #870465] Tue, 08 May 2012 09:33 Go to previous messageGo to next message
Cristina Murillo is currently offline Cristina Murillo
Messages: 25
Registered: December 2011
Junior Member
Hi!

I was finally able to import my model correctly into the workspace, including the uml stereotypes and their properties! Smile

I erroneously thought that it was enough for the DAM profile and the Example Project to be imported into eclipse workspace, but it seems that they need to be in the same path, not only in the workspace. So I moved the DAM profile to the same folder where I had the example project and it worked!

Regarding the warning I was getting, "ignoring the profiles", I found that under Window->Preferences->VIATRA2->UML2 Importer, the option "Ignore specified profiles" was enabled, so I just disabled this option.

Thank you so much for all the help! Smile I think it is great that Viatra has such good support for the users.

Regards,
Cristina
Re: Stereotypes not shown in modelspace [message #870510 is a reply to message #870507] Tue, 08 May 2012 09:42 Go to previous message
Abel Hegedus is currently offline Abel Hegedus
Messages: 88
Registered: July 2009
Member
Hi,

It's great to hear that it finally works. I'm not sure, but the path issue is actually not the fault of our importer, but may be the fault of the UML resource implementation...

Yes, you can set the list of ignored profiles, if you don't want to import some, or select to disable it and import everything.

Thank you for your kind words!
Previous Topic:MMT newsgroup
Next Topic:Error on importing EMF model
Goto Forum:
  


Current Time: Wed Jul 23 10:12:30 EDT 2014

Powered by FUDForum. Page generated in 0.03018 seconds