Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Getting container across different resources
Getting container across different resources [message #1454694] Tue, 28 October 2014 17:14 Go to next message
Jim S. is currently offline Jim S.Friend
Messages: 17
Registered: October 2014
Junior Member
Hi,

in my model uses different resources: one for basic components which are then assembled in another model (illustrated by the packages):
index.php/fa/19694/0/

I want to create an editor for the assembly-model. In this editor I currently try to write a creation Tool for the connection. I added a change-context-tool with this expression "[self.eContainer().eContainer()/] but instead of getting the correct "Composition" instance I get "Repository".
How can I get the correct context in this scenario?
Re: Getting container across different resources [message #1455309 is a reply to message #1454694] Wed, 29 October 2014 08:23 Go to previous messageGo to next message
Steve Monnier is currently offline Steve MonnierFriend
Messages: 572
Registered: May 2011
Senior Member
Hello,

On the screenshot, The "Composition" metaclass contains the "Connection"
metaclass using the reference "connections". Therefore, I think that
your expression should only be [self.eContainer()/].

Regards,
Steve

Le 28/10/2014 18:14, Jim S. a écrit :
> Hi,
>
> in my model uses different resources: one for basic components which are then assembled in another model (illustrated by the packages):
>
>
> I want to create an editor for the assembly-model. In this editor I currently try to write a creation Tool for the connection. I added a change-context-tool with this expression "[self.eContainer().eContainer()/] but instead of getting the correct "Composition" instance I get "Repository".
> How can I get the correct context in this scenario?
>


--
Steve Monnier - Obeo

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


Steve Monnier - Obeo Canada
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Getting container across different resources [message #1455426 is a reply to message #1455309] Wed, 29 October 2014 11:06 Go to previous messageGo to next message
Jim S. is currently offline Jim S.Friend
Messages: 17
Registered: October 2014
Junior Member
This does not work because I need to switch the context to the composition before creating the conncetion. "self" referes to the context switch tool at the point where I write the expression.

I found this topic which seems to have a related problem in the meantime, but I cannot use its query. When I do [sourceView.getParentDiagram().oclAsType(DSemanticDecorator).target/] I get a "unknow Variable DSemanticDecorator" error.

Edit: I used DSemanticDiagram now instead of DSemanticDecorator which solves the problem. But why isnt it working with DSemanticDecorator?

[Updated on: Wed, 29 October 2014 11:49]

Report message to a moderator

Re: Getting container across different resources [message #1456398 is a reply to message #1454694] Thu, 30 October 2014 10:12 Go to previous messageGo to next message
Steve Monnier is currently offline Steve MonnierFriend
Messages: 572
Registered: May 2011
Senior Member
Hello,

I have read and reply at your previous post too quickly. For your
"change context" task, I think you should use the edge creation tool
variable "source" and use the eContainer reference (opposite of the
wrappers reference): [source.eContainer()/]. This way, you find the
parent "Composition" of the "Wrappers" you are connecting and create a
"Connection" in this parent "Composition". Then you will need to set the
"Connection" reference "sourceWrapper" and "targetWrapper" using
respectivly the edge creation tool variables "source" and "target".

Regards,
Steve

Le 28/10/2014 18:14, Jim S. a écrit :
> Hi,
>
> in my model uses different resources: one for basic components which are then assembled in another model (illustrated by the packages):
>
>
> I want to create an editor for the assembly-model. In this editor I currently try to write a creation Tool for the connection. I added a change-context-tool with this expression "[self.eContainer().eContainer()/] but instead of getting the correct "Composition" instance I get "Repository".
> How can I get the correct context in this scenario?
>


--
Steve Monnier - Obeo

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


Steve Monnier - Obeo Canada
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Getting container across different resources [message #1456662 is a reply to message #1455426] Thu, 30 October 2014 15:42 Go to previous message
Pierre-Charles David is currently offline Pierre-Charles DavidFriend
Messages: 703
Registered: July 2009
Senior Member
Le 29/10/2014 12:06, Jim S. a écrit :
> When I do
> [sourceView.getParentDiagram().oclAsType(DSemanticDecorator).target/] I
> get a "unknow Variable DSemanticDecorator" error.

Maybe with oclAsType(viewpoint::DSemanticDecorator) to remove the ambiguity?


--
Pierre-Charles David - Obeo

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


Pierre-Charles David - Obeo

Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Previous Topic:Combining parts of Edges into one.
Next Topic:Saving style changes
Goto Forum:
  


Current Time: Fri Apr 26 18:14:26 GMT 2024

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

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

Back to the top