|
Re: Getting container across different resources [message #1455309 is a reply to message #1454694] |
Wed, 29 October 2014 08:23 |
|
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 |
Jim S. 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 |
|
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
|
|
|
|
Powered by
FUDForum. Page generated in 0.03151 seconds