Nested Containment in GMFMap definition [message #159540] |
Sun, 11 November 2007 19:07  |
Eclipse User |
|
|
|
Hi, I have been battling with this nested containment problem when
creating gmfmap model for quite a while. I hope someone can shed some
light. My semantic model is like following: at the root is a
ShippingApplication class, it contains a list of Port, the Port class
contains a list of Route which in turn has a departing and arriving
references back to the Port, the Route also refers (no containment though)
to a list of Ship objects. The Port and Ship will be represented by Node
and Route by Connection. The resulting XMI will looks something like:
<shippingApplication>
<ports name="Port1">
<routes name="P1ToP2" departing="//@ports.0" arriving="//@ports.1"
ships="//@ships.0 //@ships.1"/>
<routes name="P1ToP3" departing="//@ports.0" arriving="//@ports.2"
ships="//@ships.2 //@ships.3"/>
</ports>
<ports name="Port2">
<routes name="P2ToP3" departing="//@ports.1" arriving="//@ports.2"
ships="//@ships.4"/>
</ports>
<ports name="Port3"/>
<ships name="Ship1">
<ships name="Ship2">
<ships name="Ship3">
<ships name="Ship4">
<ships name="Ship5">
......
</shippingApplication>
The problem is that when I tried to create gmfmap model, there was no
options for specifying the link on <Route, ships>. If I moved Route out of
the containment in Port (i.e. put Route directly under
ShippingApplication), the link would show up and everything would be fine.
It looks to me the problem was caused by the two levels of nested
containment. Furthermore, if every class is represented by Node, the
nested containment can be solved by defining Compartment on owning object
and thus go down the chain. How can I achieve the same thing when one of
the classes is represented by Connection? Any help appreciated.
Thanks in advance for your time.
|
|
|
Re: Nested Containment in GMFMap definition [message #159750 is a reply to message #159540] |
Mon, 12 November 2007 15:28  |
Eclipse User |
|
|
|
Hello Simprofeng,
There should be no problems with specifying a link from Port to Ship represented
by Route instance (if I understood your requirements correctly). If Port/Ship
elements are not a top-level diagram nodes then you can face the following
problem: currently it is impossible to draw links to/from GenChildLabelNodes
(elements of .gmfgen model). The workaround is creating GenChildNodes instead.
Can you please post here node/link mappings (with all the necessary features)
used to describe Port/Ship/Route in your application?
-----------------
Alex Shatalin
|
|
|
Powered by
FUDForum. Page generated in 0.03231 seconds