Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Different containment references for the same class(Different containment references for the same class)
Different containment references for the same class [message #1761184] Mon, 08 May 2017 15:52 Go to next message
Antonio Garmendia is currently offline Antonio GarmendiaFriend
Messages: 93
Registered: May 2014
Member
Hi,

I have this metamodel:
index.php/fa/29282/0/

Component is a Container
Port is a bordered node
I can create Component inside Component Diagram or within a Component.

I'm facing a problem when defining the element creation. If the different containment reference has the same name (e.g. containsComponent) would not be a problem (Create Instance->Reference Name: containsComponent). Due to the names of the containment references are not the same, I am trying to create the instance using a switch as I show in the following image, but I get this error.

index.php/fa/29283/0/

This is the best approach? I am stuck doing this, any hint will be appreciated.

Cheers,
Anthony
  • Attachment: mm.png
    (Size: 23.11KB, Downloaded 441 times)
  • Attachment: design.png
    (Size: 52.88KB, Downloaded 456 times)
Re: Different containment references for the same class [message #1761295 is a reply to message #1761184] Tue, 09 May 2017 13:48 Go to previous messageGo to next message
Julien Dupont is currently offline Julien DupontFriend
Messages: 172
Registered: July 2009
Senior Member
Hi,

The problem must be that your metamodel is not registered in the Odesign -> ComponentDiagram, Metamodels tab (Add from registry * .componentDiagram).

If you can change the metamodel, the best and simply appraoch is to define the same reference for ComponentDiagram and Component.

Regards,

[Updated on: Tue, 09 May 2017 13:49]

Report message to a moderator

Re: Different containment references for the same class [message #1761310 is a reply to message #1761295] Tue, 09 May 2017 15:47 Go to previous messageGo to next message
Antonio Garmendia is currently offline Antonio GarmendiaFriend
Messages: 93
Registered: May 2014
Member
Hi Julien,

Thanks! You are right, the metamodel was not registered in the odesign. The thing is that I cannot change the metamodel.

The problem I am having after this issue is that the container does not seems to work fine. The addition of the Component works fine but the container does not show the vertical or horizontal scroll bar. Maybe I am making a mistake when I define the Semantic Candidates Expression. See figure below

index.php/fa/29287/0/

Any ideas?

Cheers,
Anthony
  • Attachment: example.png
    (Size: 95.97KB, Downloaded 263 times)
Re: Different containment references for the same class [message #1761354 is a reply to message #1761310] Wed, 10 May 2017 07:36 Go to previous messageGo to next message
Julien Dupont is currently offline Julien DupontFriend
Messages: 172
Registered: July 2009
Senior Member
Hi,

Do you want to display or create Component in component?

For that you must used the reused container mapping and a service.
You can find an example joined.

Regards,
Re: Different containment references for the same class [message #1761444 is a reply to message #1761354] Thu, 11 May 2017 09:05 Go to previous message
Antonio Garmendia is currently offline Antonio GarmendiaFriend
Messages: 93
Registered: May 2014
Member
Hi,

Thanks! your example works well and was very helpful. Another approach could be instead of using a service is to make an aql statement:

aql:if (self.oclIsKindOf(componentDiagram::ComponentDiagram)) then self.component else self.containsComponent endif

Cheers,
Anthony
Previous Topic:Table representation
Next Topic:Reconnect Edge and Sirius validator
Goto Forum:
  


Current Time: Thu Apr 25 17:56:52 GMT 2024

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

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

Back to the top