Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Multiple model files?(getting elements from other model files in one diagram)
icon5.gif  Multiple model files? [message #1276671] Mon, 24 March 2014 22:23 Go to next message
Jeroen Kouwer is currently offline Jeroen KouwerFriend
Messages: 7
Registered: March 2014
Junior Member
Hello,

I'm just starting to use Sirius. As a Thales employee I do have some prior knowledge, but this is my first serious attempt with creating a DSL. I really love the fact that this kind of tooling is becoming available as open source!

I've managed to install Sirius and create the basic family model from scratch. I've extended the meta model with information on relations and adapted the editor to accomadate this.

So far so good.

Now in my second example family I distributed my family over multiple files. I started with a file that contains a Man, and another file that contains the Woman. Just as in real life they do not know beforehand that they will have a relation (we're not living in the middle ages anymore).

What I would like to do is to create a new model (based on Family) drag in the man and the woman from the two models I already created, and define the relation between them in this third model.

With the generated EMF editor this functionality is available (I really don't know how it is done, but it works). I can create the <surname>.basicfamily. Drag and drop the files into the editor (which mentions 'resource set' at the top) and create the relation in the new model pointing to elements in the other files. I would like to be able to do this with my diagram too, but with my created editor I do not see the relation, nor the persons, just the elements from the new file (once there is enough information to draw them).

Is working with information from multiple model files on one diagram possible with Sirius? If so, where can I find more information on how to enable / use / configure this kind of functionality?

Kind regards,
Jeroen Kouwer
Re: Multiple model files? [message #1276958 is a reply to message #1276671] Tue, 25 March 2014 09:14 Go to previous messageGo to next message
Alex Lagarde is currently offline Alex LagardeFriend
Messages: 193
Registered: May 2010
Senior Member

Hi Jeroen,

first of all, thanks for your interest in Sirius and your refreshing tone :)

I'm not sure I understand correctly what you want to do.

To drop several model elements comming from several resources in a same
diagram , you just need to define a "Container Drop Description" and
select "Model" or "Both" as Drag Source. Then you will be able to drop
your persons contained in other resources from the Model Explorer View
to your diagram.

If you want to leave the persons in their own resources and just display
them in your diagram to be able to create a relationship, then you
should use "Not synchronized" mappings [1]

A very good usage example is Ecore Tools 2.0's Class diagram. It
provides the exact behavior you are describing, with associated tools to
show the model elements coming from other resources.

Could you please check Ecore Tools 2 VSM [2], and take a look at the
"Entities" diagram description ? You can see for example that EC EClass
Mappings are "Not Synchronized", and that a Selection Wizard is used to
add model elements to the diagram (in the "Existing Elements" Section).

Do not hesitate if you have further questions,
Alex

[1]
http://www.eclipse.org/sirius/doc/specifier/diagrams/Diagrams.html#graphical_elements
("Synchronization" section)

[2]
http://git.eclipse.org/c/ecoretools/org.eclipse.ecoretools.git/plain/org.eclipse.emf.ecoretools.design/description/ecore.odesign

Le 25/03/2014 03:58, Jeroen Kouwer a écrit :
> Hello,
>
> I'm just starting to use Sirius. As a Thales employee I do have some
> prior knowledge, but this is my first serious attempt with creating a
> DSL. I really love the fact that this kind of tooling is becoming
> available as open source!
>
> I've managed to install Sirius and create the basic family model from
> scratch. I've extended the meta model with information on relations and
> adapted the editor to accomadate this.
>
> So far so good.
>
> Now in my second example family I distributed my family over multiple
> files. I started with a file that contains a Man, and another file that
> contains the Woman. Just as in real life they do not know beforehand
> that they will have a relation (we're not living in the middle ages
> anymore).
>
> What I would like to do is to create a new model (based on Family) drag
> in the man and the woman from the two models I already created, and
> define the relation between them in this third model.
>
> With the generated EMF editor this functionality is available (I really
> don't know how it is done, but it works). I can create the
> <surname>.basicfamily. Drag and drop the files into the editor (which
> mentions 'resource set' at the top) and create the relation in the new
> model pointing to elements in the other files. I would like to be able
> to do this with my diagram too, but with my created editor I do not see
> the relation, nor the persons, just the elements from the new file (once
> there is enough information to draw them).
>
> Is working with information from multiple model files on one diagram
> possible with Sirius? If so, where can I find more information on how to
> enable / use / configure this kind of functionality?
>
> Kind regards,
> Jeroen Kouwer
icon14.gif  Re: Multiple model files? [message #1277263 is a reply to message #1276958] Tue, 25 March 2014 19:04 Go to previous messageGo to next message
Jeroen Kouwer is currently offline Jeroen KouwerFriend
Messages: 7
Registered: March 2014
Junior Member
Hello Alex,

Alex Lagarde wrote on Tue, 25 March 2014 05:14

I'm not sure I understand correctly what you want to do.

Based on your answer I think you pretty much figured out what I wanted to do Smile

I'll look into the examples that you mentioned.

Thanks for the reply and the signposts to more information,
Jeroen
Re: Multiple model files? [message #1277361 is a reply to message #1276958] Tue, 25 March 2014 22:34 Go to previous messageGo to next message
Jeroen Kouwer is currently offline Jeroen KouwerFriend
Messages: 7
Registered: March 2014
Junior Member
Ok.

I read the part about the "Not synchronized" mappings [1] and downloaded the Ecore Tools 2 VSM [2]. The first gave me headaches, and the second wouldn't open in the Sirius perspective.

So much for a good start Wink

Then I decided to download the ecoretools 2 project, because opening the VSM resulted in unresolved references. This made me think that I might actually miss something and I thought that having the whole project could solve the unresolved references. I installed m2e (which claims to be maven 3.0.4 compatible, and that should be sufficient according to the readme of the ecoretools [3]) and did the adviced "mvn clean package" in the build project...

bummer.

The build failed on the project containing the VSM Rolling Eyes with among others the following output:

[INFO] org.eclipse.emf.ecoretools.design ................. FAILURE [0.650s]

[ERROR] Failed to execute goal org.eclipse.tycho:tycho-compiler-plugin:0.18.1:compile (default-compile) on project org.eclipse.emf.ecoretools.design: Compilation failure: Compilation failure:
[ERROR] C:\Users\Jeroen\Workspaces\ecoretools-master\org.eclipse.emf.ecoretools.design\src\org\eclipse\emf\ecoretools\design\service\ReviewServices.java:[11,0]
[ERROR] import org.eclipse.sirius.business.api.query.DDiagramElementQuery;
[ERROR] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[ERROR] The import org.eclipse.sirius.business.api.query.DDiagramElementQuery cannot be resolved
[ERROR] C:\Users\Jeroen\Workspaces\ecoretools-master\org.eclipse.emf.ecoretools.design\src\org\eclipse\emf\ecoretools\design\service\ReviewServices.java:[62,0]
[ERROR] Option<DDiagram> diag = new EObjectQuery(view).getParentDiagram();
[ERROR] ^^^^^^^^^^^^^^^^
[ERROR] The method getParentDiagram() is undefined for the type EObjectQuery
[ERROR] C:\Users\Jeroen\Workspaces\ecoretools-master\org.eclipse.emf.ecoretools.design\src\org\eclipse\emf\ecoretools\design\service\ReviewServices.java:[120,0]
[ERROR] if (!new DDiagramElementQuery(list).isHidden()
[ERROR] ^^^^^^^^^^^^^^^^^^^^
[ERROR] DDiagramElementQuery cannot be resolved to a type

(followed by 20 other errors in the same category)

I am obviously missing something here, but I fail to see what.

My eclipse installation now contains the following:

- A download of "Eclipse Modelling Tools" from the eclipse download page [4] (Now that I type this message I see the "Eclipse IDE for Java and DSL Developers" just above it, maybe this one is better?)
- Eclipse Sirius 0.9 (from the eclipse marketplace).
- Maven Integrarion for Eclipse (Juno and newer) 1.4 (also from the eclipse Marketplace).

Maybe I am missing some installation?

When I look into the org.eclipse.emf.ecoretools.design project there are also errors (which is probably why the build fails Confused ):

import org.eclipse.sirius.diagram.DDiagram;
import org.eclipse.sirius.diagram.DEdge;
import org.eclipse.sirius.diagram.DSemanticDiagram;
import org.eclipse.sirius.diagram.DiagramPackage;
import org.eclipse.sirius.diagram.EdgeTarget

And when I open the *.odesign file the following error is produced:

org.eclipse.emf.ecore.xmi.UnresolvedReferenceException: Unresolved reference '//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@containerMappings[name='EC%20EClass']'. (platform:/resource/org.eclipse.emf.ecoretools.design/description/ecore.odesign, 22, 281)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.handleForwardReferences(XMLHandler.java:1161)

note: actually there is a lot more error messages available. I just listed the top three of maven, the first few of the code and the first line of the Sirius view openingn the VSM.

Do I need a previous version of the VSM in order to open it in the Sirius view? Do I need an update of Sirius? ... ?

Any help is appreciated. And if you need more information, please ask, I'm happy to provide.

Kind regards,
Jeroen

[1]
http://www.eclipse.org/sirius/doc/specifier/diagrams/Diagrams.html#graphical_elements
("Synchronization" section)

[2]
http://git.eclipse.org/c/ecoretools/org.eclipse.ecoretools.git/plain/org.eclipse.emf.ecoretools.design/description/ecore.odesign

[3]
https:// github.com/eclipse/ecoretools

[4]
https://www.eclipse.org/downloads/
Re: Multiple model files? [message #1277620 is a reply to message #1277361] Wed, 26 March 2014 08:30 Go to previous messageGo to next message
Alex Lagarde is currently offline Alex LagardeFriend
Messages: 193
Registered: May 2010
Senior Member

Hi Jeroen,

it seems that the Ecore Tools version you are using is not compatible
with your Sirius version.

Could you please try to install Ecore Tools 2.x & Sirius M6 [1] and [2] ?

Best regards,
Alex

[1]
http://download.eclipse.org/modeling/emft/ecoretools/updates/milestones/2.0.0M6/luna/
[2] https://wiki.eclipse.org/Sirius/1.0.0M6
Re: Multiple model files? [message #1278319 is a reply to message #1277620] Thu, 27 March 2014 07:00 Go to previous messageGo to next message
Jeroen Kouwer is currently offline Jeroen KouwerFriend
Messages: 7
Registered: March 2014
Junior Member
Hello Alex,

Thanks for the info.

I think I'll try this weekend to make it work.

And maybe I'll take a leap of faith and also move from Keppler to the milestone releases of Luna... Smile

Kind regards,
Jeroen Kouwer

(Who is blatantly ignoring the advice to never change more than one thing at a time...)
Re: Multiple model files? [message #1280024 is a reply to message #1277620] Sat, 29 March 2014 17:18 Go to previous messageGo to next message
Jeroen Kouwer is currently offline Jeroen KouwerFriend
Messages: 7
Registered: March 2014
Junior Member
Hello Alex,

I just wanted to let you know that everything is insalled and working fine (and all on Luna M6 Cool ).

I can see the EC Class, the not synchronized, the drop description, etc.

Now all I need to do is to figure out how to reproduce this for my basicfamily, but at least I got the complete ecore tools 2 project as an example (I do hope that my relation candidates are still willing to relate when I finally have managed to get them together on one diagram...). Let's get to it!

Thanks again,

Jeroen
Re: Multiple model files? [message #1280757 is a reply to message #1277620] Sun, 30 March 2014 22:31 Go to previous messageGo to next message
Jeroen Kouwer is currently offline Jeroen KouwerFriend
Messages: 7
Registered: March 2014
Junior Member
Hello Alex,

I've managed to make things work! I now can have elements from multiple resources in one diagram Very Happy . To me that is something. I also managed to mark the 'imported' elements with a shortcut (borrowed from the ecoretools).

The link [1] points to an image with the result of my effort. Maybe small in the eyes of some, but I am quite happy with it Smile .

Thanks again for pointing me in the right direction.

Kind regards,
Jeroen

[1] http://tinyurl.com/kfakjlj

[Updated on: Sun, 30 March 2014 22:35]

Report message to a moderator

Re: Multiple model files? [message #1280985 is a reply to message #1280757] Mon, 31 March 2014 07:28 Go to previous message
Alex Lagarde is currently offline Alex LagardeFriend
Messages: 193
Registered: May 2010
Senior Member

Hi Jeroen,

glad to hear that ! Please let us know if you have further questions.

Regards,
Alex
Previous Topic:Connecting to CDO repository
Next Topic:Specifying Save/Load options at runtime
Goto Forum:
  


Current Time: Thu Apr 25 14:42:08 GMT 2024

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

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

Back to the top