Home » Modeling » GMF (Graphical Modeling Framework) » Same link from different classes
Same link from different classes [message #142628] |
Fri, 13 July 2007 10:59  |
Eclipse User |
|
|
|
Originally posted by: jiri_semecky.cz.ibm.com
Hi all,
in my semantic model I use a single type of link, which can lead from
different types of elements to different types of elements.
E.g.
A --> A
A --> B
A --> C
B --> A
C --> A
The eCore model is serialized into XML, the links are represented using
element with a target attribute (the attribute always has the same name):
<A id="a1">
<link target="b1" />
<link target="a2" />
<link target="a1" />
</A>
<B id="b1>
<link target="a1"/>
</B>
<A id="a2" />
I have problems defining this in GMF mapping model.
1. [question] is it possible to define one link mapping for all the
possible transitions?
I only managed to define the transitions when defining a single link
mapping for each possible target source.
2. [inconvenience] if I define different link mapping for different link
sources, the editing is quite tough, because in the Containment Feature,
there is a list of equivalent links, one for each source type.
3. [bug] when initializing diagram from the semantic model ("Initialize
new diagram") only the first type of links is recovered, while the
second, third, ... are not generated in the diagram.
Do I define the mapping somehow incorrectly? How should this be done right?
Thank you for any hint,
--Jiri
|
|
|
Re: Same link from different classes [message #142748 is a reply to message #142628] |
Mon, 16 July 2007 04:40   |
Eclipse User |
|
|
|
Originally posted by: 5d5.mail.ru
You should define a link mapping for each combination of source/end
(unless possible sources and targets don't inherit from a common type or
implement common interface). You may define single tool that will create
all these links so there will be illusion that this is a one kind of
link for end users.
Jiri Semecky wrote:
> Hi all,
>
> in my semantic model I use a single type of link, which can lead from
> different types of elements to different types of elements.
> E.g.
> A --> A
> A --> B
> A --> C
> B --> A
> C --> A
>
> The eCore model is serialized into XML, the links are represented using
> element with a target attribute (the attribute always has the same name):
> <A id="a1">
> <link target="b1" />
> <link target="a2" />
> <link target="a1" />
> </A>
> <B id="b1>
> <link target="a1"/>
> </B>
> <A id="a2" />
>
> I have problems defining this in GMF mapping model.
>
> 1. [question] is it possible to define one link mapping for all the
> possible transitions?
> I only managed to define the transitions when defining a single link
> mapping for each possible target source.
>
> 2. [inconvenience] if I define different link mapping for different link
> sources, the editing is quite tough, because in the Containment Feature,
> there is a list of equivalent links, one for each source type.
>
> 3. [bug] when initializing diagram from the semantic model ("Initialize
> new diagram") only the first type of links is recovered, while the
> second, third, ... are not generated in the diagram.
>
> Do I define the mapping somehow incorrectly? How should this be done right?
>
> Thank you for any hint,
>
> --Jiri
>
>
|
|
|
Re: Same link from different classes [message #142829 is a reply to message #142748] |
Mon, 16 July 2007 12:15   |
Eclipse User |
|
|
|
Originally posted by: jiri_semecky.cz.ibm.com
Thank you for the hint.
However, this works only partially. I used common abstract type (class)
for targets of the link. I didn't manage to create a common interface
for the link sources, so I defined the Link Mapping five times.
In the diagram, I can use mouse to create the link in the semantic
model, however it is not displayed in the diagram, except of the link
which corresponds to the first Link Mapping.
I've encountered this behavior in the GMF 1 already.
Is this a bug or am I missing something here?
For the link I'm using an element included in the source element
(leaving "Source Feature" empty) and the links has no id. Could this be
a problem?
--Jiri
> You should define a link mapping for each combination of source/end
> (unless possible sources and targets don't inherit from a common type or
> implement common interface). You may define single tool that will create
> all these links so there will be illusion that this is a one kind of
> link for end users.
>
> Jiri Semecky wrote:
>> Hi all,
>>
>> in my semantic model I use a single type of link, which can lead from
>> different types of elements to different types of elements.
>> E.g.
>> A --> A
>> A --> B
>> A --> C
>> B --> A
>> C --> A
>>
>> The eCore model is serialized into XML, the links are represented
>> using element with a target attribute (the attribute always has the
>> same name):
>> <A id="a1">
>> <link target="b1" />
>> <link target="a2" />
>> <link target="a1" />
>> </A>
>> <B id="b1>
>> <link target="a1"/>
>> </B>
>> <A id="a2" />
>>
>> I have problems defining this in GMF mapping model.
>>
>> 1. [question] is it possible to define one link mapping for all the
>> possible transitions?
>> I only managed to define the transitions when defining a single link
>> mapping for each possible target source.
>>
>> 2. [inconvenience] if I define different link mapping for different
>> link sources, the editing is quite tough, because in the Containment
>> Feature, there is a list of equivalent links, one for each source type.
>>
>> 3. [bug] when initializing diagram from the semantic model
>> ("Initialize new diagram") only the first type of links is recovered,
>> while the second, third, ... are not generated in the diagram.
>>
>> Do I define the mapping somehow incorrectly? How should this be done
>> right?
>>
>> Thank you for any hint,
>>
>> --Jiri
>>
>>
|
|
|
Re: Same link from different classes [message #142839 is a reply to message #142748] |
Mon, 16 July 2007 12:34  |
Eclipse User |
|
|
|
Hi,
I would not recommend to define several different links and use a single
tool to pretend they are one, because this approach makes it impossible
to reroute these links, or at least requires lots of hand-coding to
enable rerouting. If at all possible, defining a single supertype for
link ends should be preferred.
Best regards,
Boris
Dmitry Stadnik wrote:
> You should define a link mapping for each combination of source/end
> (unless possible sources and targets don't inherit from a common type or
> implement common interface). You may define single tool that will create
> all these links so there will be illusion that this is a one kind of
> link for end users.
>
> Jiri Semecky wrote:
>> Hi all,
>>
>> in my semantic model I use a single type of link, which can lead from
>> different types of elements to different types of elements.
>> E.g.
>> A --> A
>> A --> B
>> A --> C
>> B --> A
>> C --> A
>>
>> The eCore model is serialized into XML, the links are represented
>> using element with a target attribute (the attribute always has the
>> same name):
>> <A id="a1">
>> <link target="b1" />
>> <link target="a2" />
>> <link target="a1" />
>> </A>
>> <B id="b1>
>> <link target="a1"/>
>> </B>
>> <A id="a2" />
>>
>> I have problems defining this in GMF mapping model.
>>
>> 1. [question] is it possible to define one link mapping for all the
>> possible transitions?
>> I only managed to define the transitions when defining a single link
>> mapping for each possible target source.
>>
>> 2. [inconvenience] if I define different link mapping for different
>> link sources, the editing is quite tough, because in the Containment
>> Feature, there is a list of equivalent links, one for each source type.
>>
>> 3. [bug] when initializing diagram from the semantic model
>> ("Initialize new diagram") only the first type of links is recovered,
>> while the second, third, ... are not generated in the diagram.
>>
>> Do I define the mapping somehow incorrectly? How should this be done
>> right?
>>
>> Thank you for any hint,
>>
>> --Jiri
>>
>>
|
|
|
Goto Forum:
Current Time: Fri Jul 25 12:09:33 EDT 2025
Powered by FUDForum. Page generated in 0.04270 seconds
|