Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Distinguish different representations of the same class instance
Distinguish different representations of the same class instance [message #1435369] Wed, 01 October 2014 11:59 Go to next message
Jim S. is currently offline Jim S.Friend
Messages: 17
Registered: October 2014
Junior Member
Hi,

I have want to create an editor for an model which represents the composition of components. The metamodel wraps each of these components in different contexts. Those contexts are my nodes and I created Bordered Nodes for their ports which I got from the wrapped component. My problem is now, that if there are two contexts with the same component both ports are mappings of the same object. So far I could not think of a way to distinguish those, is it somehow possible?

A workaround I thought of was to create custom decorators for edge so that I could create the edge directly to the context. But I dont think this is the best way and I dont even know how to create custom decorators.
Re: Distinguish different representations of the same class instance [message #1439601 is a reply to message #1435369] Tue, 07 October 2014 10:11 Go to previous messageGo to next message
Jim S. is currently offline Jim S.Friend
Messages: 17
Registered: October 2014
Junior Member
I created a diagram which should illustrate the issue:
index.php/fa/19401/0/
In this model the upper row (Wrapper and Connection) are used to assemble different WrappedClasses.

If I want to create an editor for this metamodel I want to be able to display the Connections. If I have two Wrappers with the same WrappedClasses a Connection to one of the Wrappers I cannot figure out a way to distinguish between the representations of the Connectors on both Wrappers even though they are mappings of the same instance.
  • Attachment: metamodel.jpg
    (Size: 13.99KB, Downloaded 251 times)
Re: Distinguish different representations of the same class instance [message #1439859 is a reply to message #1439601] Tue, 07 October 2014 15:50 Go to previous messageGo to next message
Steve Monnier is currently offline Steve MonnierFriend
Messages: 470
Registered: May 2011
Senior Member
Hello,

I'm not sure if I understood entirely your context, but I think that you
need an Element Base Edge mapping where the Domain Class is Connectionn.
Then the SourceMapping and the TargetMapping are the mapping of the
"WrappedClass" element. The source finder expression should be using the
portOne relation and the opposite reference of "connectors". Likewise,
the target finder expression should be using portTwo and the opposite
reference of "connectors".

Regards,
Steve

Le 07/10/2014 12:11, Jim S. a écrit :
> I created a diagram which should illustrate the issue:
>
> In this model the upper row (Wrapper and Connection) are used to assemble different WrappedClasses.
>
> If I want to create an editor for this metamodel I want to be able to display the Connections. If I have two Wrappers with the same WrappedClasses a Connection to one of the Wrappers I cannot figure out a way to distinguish between the representations of the Connectors on both Wrappers even though they are mappings of the same instance.
>


--
Steve Monnier - Obeo

Need professional services for Sirius?
http://www.obeodesigner.com/sirius


Steve Monnier - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Distinguish different representations of the same class instance [message #1440074 is a reply to message #1439859] Tue, 07 October 2014 23:11 Go to previous messageGo to next message
Jim S. is currently offline Jim S.Friend
Messages: 17
Registered: October 2014
Junior Member
That works for me, too. I just recognized that the metamodel I uploaded cannot produce the situation im refering to.

This updated one should work:
index.php/fa/19416/0/
If I create the Connectors as BorderedNodes on the Wrapper, is it possible to have the Connection displayed between only the two Connectors which are on the Border of the Wrapper refered to by "instanceTarget" and "instanceSource" of the Connection?
  • Attachment: metamodel.jpg
    (Size: 16.15KB, Downloaded 222 times)
Re: Distinguish different representations of the same class instance [message #1440346 is a reply to message #1440074] Wed, 08 October 2014 08:43 Go to previous messageGo to next message
Steve Monnier is currently offline Steve MonnierFriend
Messages: 470
Registered: May 2011
Senior Member
Hello,

Well I think that you can do it that way as well, but your metamodel is
more complex than the previous one. You will now have to set the new
references from Connection, that are redundant. In the previous version,
you can create an expression that navigates using an opposite reference
from connectors and wrapped.

Regards,
Steve

Le 08/10/2014 01:11, Jim S. a écrit :
> That works for me, too. I just recognized that the metamodel I uploaded cannot produce the situation im refering to.
>
> This updated one should work:
>
> If I create the Connectors as BorderedNodes on the Wrapper, is it possible to have the Connection displayed between only the two Connectors which are on the Border of the Wrapper refered to by "instanceTarget" and "instanceSource" of the Connection?
>


--
Steve Monnier - Obeo

Need professional services for Sirius?
http://www.obeodesigner.com/sirius


Steve Monnier - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Distinguish different representations of the same class instance [message #1440523 is a reply to message #1440346] Wed, 08 October 2014 13:19 Go to previous messageGo to next message
Jim S. is currently offline Jim S.Friend
Messages: 17
Registered: October 2014
Junior Member
I still cant get it to work. I have created an example model:
index.php/fa/19429/0/

With this I tried two approaches:
1.: Have an Element Based Edge between the two wrappers. The Edge is then displayed between the correct wrappers but I want it to be displayed to the Bordered Nodes which represent the Connectors:
index.php/fa/19430/0/
index.php/fa/19431/0/

2.: If I try to create the Edge between the Bordered Nodes there is a second edge, since the ports of Wrapper 1 and 2 are the same instance. This is not intended:
index.php/fa/19432/0/
index.php/fa/19433/0/

I want to have a mix of both results, that only display the correct edge, but between the Connectors. Is this possible?
Re: Distinguish different representations of the same class instance [message #1442082 is a reply to message #1440523] Fri, 10 October 2014 15:34 Go to previous messageGo to next message
Steve Monnier is currently offline Steve MonnierFriend
Messages: 470
Registered: May 2011
Senior Member
Hello,

I think that even in your second solution, you need to start your
source/target finder expression using the wrapper (sourceWrapper and
targetWrapper) + the navigation to the connector. The last one must be
the one used as the semantic expression for your border node. So it
would be something like source finder expression
[sourceWrapper.connector/] and target finder expression
[targetWrapper.connector/].
If this doesn't work, can you join the Metamodel+VSM? It will be easier
to test.

Regards,
Steve

Le 08/10/2014 15:19, Jim S. a écrit :
> I still cant get it to work. I have created an example model:
>
>
> With this I tried two approaches:
> 1.: Have an Element Based Edge between the two wrappers. The Edge is then displayed between the correct wrappers but I want it to be displayed to the Bordered Nodes which represent the Connectors:
>
>
>
> 2.: If I try to create the Edge between the Bordered Nodes there is a second edge, since the ports of Wrapper 1 and 2 are the same instance. This is not intended:
>
>
>
> I want to have a mix of both results, that only display the correct edge, but between the Connectors. Is this possible?
>


--
Steve Monnier - Obeo

Need professional services for Sirius?
http://www.obeodesigner.com/sirius


Steve Monnier - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Distinguish different representations of the same class instance [message #1445448 is a reply to message #1442082] Wed, 15 October 2014 13:02 Go to previous messageGo to next message
Jim S. is currently offline Jim S.Friend
Messages: 17
Registered: October 2014
Junior Member
Hi,

I tried to use [{source,target}Wrapper.wrapps.connectors/] as target finder expression, with the same result as in the second example. I suspect this is because the expression simply returns the same result as [{source,target}Connector/].

Im not sure what you mean by joining metamodel and VSP.
I uploaded the project (http://uploaded.net/file/i125bzh2) so that you can test it yourself (if thats what you meant).
Extract the archive and open the tmpworkspace in eclipse. Then launch MetaModel.editor. In the new Instance you should see the test model and the VSP.

[Updated on: Wed, 15 October 2014 13:03]

Report message to a moderator

Re: Distinguish different representations of the same class instance [message #1445543 is a reply to message #1445448] Wed, 15 October 2014 15:33 Go to previous messageGo to next message
Nikolay Manolov is currently offline Nikolay ManolovFriend
Messages: 24
Registered: June 2012
Junior Member
Hi Jim,

I think your case is similar, if not the same, to the one discussed in this topic https://www.eclipse.org/forums/index.php/m/1445542/#msg_1445542
Please have a look there for a possible solution. I have not tested the solution, so feedback will be greatly appreciated.

Cheers
Re: Distinguish different representations of the same class instance [message #1447194 is a reply to message #1445543] Fri, 17 October 2014 23:19 Go to previous message
Jim S. is currently offline Jim S.Friend
Messages: 17
Registered: October 2014
Junior Member
Wow thanks! I had exactly the same problem. With the test metamodel it worked, I will try to use it on the real metamodel tomorow.
Previous Topic:Selection Wizard and edge label
Next Topic: Split the model into several files with Sirius
Goto Forum:
  


Current Time: Sat Apr 04 10:06:08 GMT 2020

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

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

Back to the top