writing files to be imported as EMF models into Eclipse - eclipse

I'd like to generate an Eclipse EMF model in a custom tool (entirely outside of eclipse) and then save it to a format that eclipse can import and use as an EMF model. I'm looking for recommendations of what format might be a good candiate. It would be great if the format could be of a type can is stored in a text file and is (fairly) humon-readable. Also it would be good if there was, in some sense, a grammar available for the format.
Any ideas?

GenMyModel is an online modeler, released as a beta version, that corresponds perfectly to your need. You can freely test it at http://www.genmymodel.com.
GenMyModel allows you to create class models and diagrams and to export them as Ecore files (relying on XMI, a standard for exchanging metadata information, by the OMG).

Related

import model from rhapsody to papyrus

I would like to import the rhapsody models in papyrus (eclipse).
it is possible make an import in payarus in order to keep the same information?
- Use cases
- Diagrams of sequences
- classes
Furthermore. I know rhapsody has dependencies with a OXF library, when I will make the migration in papyrus'll have to specify this addiction?
thank you
You may be able to export the rhapsody project to XMI and use that to create a similar Papyrus project. You will most likely lose any diagrams and will have some weird Rhapsody stereotypes but it kinda works.
Start by creating a new Papyrus project. Close that project and open up the *.uml file in the project directory. Replace the text with the XML created from the Rhapsody project. Save. Reopen the project in Papyrus.
I tested this on a small rhapsody project. It seemed to get all the relationships and classes correct but completely messed up all the diagrams.
To answer your second question, those dependecies are for the actual code that Rhapsody generates from your UML model. So the actual model does not depend on those libraries. If you were hoping to also carry over your code from the Rhapsody model you may be out of luck.

How do I import a complete model (ie multiple XMI files) into an Enterprise Architect Project

I am trying to take a copy of the XMI files for an Enterprise Architect model and then import them into a new EA project. The "Bulk Import" option doesn't seem to do what is says on the tin.
By figuring out now the package hierarchy is mapped into the EA xml files I could do this by importing the one file at at time starting from the root package, but this is implausibly time-consuming given the number of files involved. I have tried using the "ImportPackageXMI" method on the API to automate the manual approach, but this requires the parent package GUID to be known. For the root package(s) the parent is a "Model", which is created in the new EAP (maybe it has a GUID - but not that I can figure out) and there seems no simple way of recreating the package hierarchy in any case. (I was hoping that if I imported the xmi files - using a specially created root package - then EA would work out the package structure somehow, but this was not the case!)
This seems like it should be a trivial task that should be directly supported from the tool: export model, then import model. Maybe I'm missing something or there is a simple solution for this?
For clarity, I'm using the Desktop Edition (so no scripting available).
My actual goal was to create a copy of project (EAP) that was not associated with any source control settings : my attempts via export/import of the xml it seems was not the best way to achieve this!
A simple way I have found to is to create a new (project) EAP and then open the original EAP in another window (by clicking on the EAP file in Windows explorer). Once this is done the top level packages from a model in the original can simply be copied and then pasted - using the standard shortcuts - into a model in the new EAP, which is not associated with the original source settings. Hence new source control settings can be applied and the model controlled by a new source control technology.
You could simplify this task by using Project/Data Management/Project Transfer. This way a complete copy is done, which also includes the so-called reference data. XMI does only ex-/import elements and connectors (not for example image data, glossary, etc.).
The right way to do that is firstly create a Controlled Model Branch
Then you can Import this Model Branch and it will reconstruct your complete model (branch) from all the xmi files involved.

Switching from Rhapsody to Eclipse (Papyrus) - UML model conversion?

Our team has been using Rhapsody for developing UML models and c++ code for 10+ years, and we would like to switch to Eclipse and use Papyrus for UML modeling.
We have compatibility concerns: would the UML models (all class diagrams, state machines etc) created in Rhapsody be all portable to Papyrus/Eclipse easily? Rhapsody can export UML models into XMI files (UML 2.1, 2.2, 2.3 standards). My questions is: is Papyrus able to reconstruct diagrams from XMI files
If not, are there better alternative UML plugins that work in Eclipse?
The XMI file exported by Rhapsody contains only meta data of the models. Is there a quick way to port the entire project from Rhapsody into Eclipse? Anybody experienced the similar?
Your answers will be much appreciated.
First, I must mention that I am directly involved with Papyrus, especially with the brand new Papyrus for Real Time project, at Eclipse.
First to set expectations... Moving diagrams between modeling tools has always been an exercise in frustration... There have been "standards" over the years (e.g., OMG's XMI-DI), but none seem to have been fully successful and all have necessitated a manual review. Note that I have not tried with the latest version of UML (2.5).
Now the model semantics, however, have a tendency to be more portable, especially with more recent versions of UML. I am not sure which version Rhapsody pretends to support, so it would be difficult to comment further.
With the version of Papyrus that is currently in development (with a scheduled June 2015 release), the notion of "canonical" diagram has been added. This provides for automatic creation and update of some diagrams under certain condition. for example, many behaviour diagrams, such sequence diagrams and some structure diagram, such as composite structure, can be canonical and generated from the semantic model. However, layout would still need to be adjusted. Other diagrams, such as class diagrams, would have to be manually re-created.
As was mentioned in the comment to your question, trying it out would give you the best indication of how much work is involved.
I am interested in this topic and I did a simple research on it: in fact a connector between RSA and Ppayrus is already open source https://www.eclipse.org/forums/index.php/t/835114/ it could be usefull to take a look at it and implement the same for Rhapsody.
I know that the Rhapsody XMI export did not export the graphical elements, you should probably then export them in a serialized format and mapping htem to papyrus diagram element.
other interested work but seems not to be free : modelbus https://www.modelbus.org/en/rhapsody.html which implement connectors with Papyrus EA and Rhapsody : could be also interesting to look at.
I am interested in your feedback if you did not let it down and do achive the mapping :)

Extend or configure Eclipse compare files functionality

Eclipse has built in functionality for comparing files, but how can I configure that functionality? Say I create a new file type and want an external program do perform the diff. How do I set that up?
Can I create an Eclipse plugin to add my own plugin for handling file comparisons? Or perhaps that is the answer to the first question...
You may want to look at the EMF Compare Project which helps build compare editors for EMF models. If you don't have an EMF model for your file type, you can either create one or look through the source code of EMF Compare to see how it works.
The developer guide explains how to use the code to write your custom viewers.
There is a plugin integrating Beyond Compare into Eclipse. As it is open source, you might get a clue by looking at its sources.

How to generate code by Papyrus on Eclipse?

I install Papyrus at here. So how to generate code using Papyrus ?
To generate the java code from UML you can follow the below steps.
New Project->EMF Project Press Next
give the project name
In Model Importer page select UML model and press Next
Select UML model which is created by using Papyrus.Press next
In Package selection page select all the root packages
click finish, it will generate genmodel.
Use the genmodel to generate Java code.
I hope this information helps.
In order to generate any text artifacts from UML models in the Eclipse Modelling Environment (i.e. Papyrus, TopCased, etc.) you should use Acceleo which is an eclipse implementation of the MOF models to text transformation language, the OMG standard language for models to text transformations.
It is a very well made technology but it could take some time to become familiar with it especially if you do not know MOF and the Model Driven Architecture.
QVT is another OMG language but its aim is models to models transformations (not models to text). It is therefore not the right answer to your question.
These can help you.
Papyrus Tutorials
Papyrus is an Eclipse lugin for modeling, you need to use additional Eclipse plugin to do model transformations. In the other answer you can find link to tutorials. First of them indicates you should use QVTo.
Resources:
http://wiki.eclipse.org/M2M/Operational_QVT_Language_%28QVTO%29
http://www.eclipse.org/m2m/qvto/doc
http://www.eclipse.org/modeling/m2m/downloads/index.php?project=qvtoml
To generate code from a UML diagram created with Papyrus must create a run configuration for Papyrus.
More information and a demo video at the following links.
http://www.papyrusuml.org/scripts/home/publigen/content/templates/show.asp?P=140&L=EN
http://www.papyrusuml.org/home/liblocal/docs/Documentation/Java-Code-Gen/Papyrus-GenJava-GenerateCode.swf
You need to install Papyrus Java Classes Generator.
Help --> install new software
work with : http://download.eclipse.org/modeling/mdt/papyrus/updates/releases/mars
Check group items by category
Check show only the latest version of available software
Check Papyrus Java
Next --> accept terms and conditions
finish
Now, in your model.di : right click on your class --> Java --> Generate java code.
And you're done !
It doesn't work with Java because even if you get a code from a class diagram then this code is so dirty that it is totally unusable.
It seems that this tool has been written by modelers who have never done any java codding :-)