Multiple model files? [message #1276671] |
Mon, 24 March 2014 22:23 |
Jeroen Kouwer 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 |
|
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
|
|
|
|
Re: Multiple model files? [message #1277361 is a reply to message #1276958] |
Tue, 25 March 2014 22:34 |
Jeroen Kouwer 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
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 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 ):
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/
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03010 seconds