Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Create a node by Selecting a different container
Create a node by Selecting a different container [message #1831884] Tue, 01 September 2020 18:18 Go to next message
Fares G is currently offline Fares GFriend
Messages: 3
Registered: September 2020
Junior Member
Hi,
I have a block that contains operators and Input/Output ports. I need just one Tool creation to create a Port.. If i click on the block it would be an input and if I click on the operator it would be and Output.
The first part is okay, and I added the Operator Node as extra Mapping to create a port but it seems that the product is created in the operator which is wrong. so I want to change the context and create an output Product in the system by clicking on the operator.
Could Someone help me ?

Thank you,
Fares.
Re: Create a node by Selecting a different container [message #1831989 is a reply to message #1831884] Fri, 04 September 2020 09:09 Go to previous messageGo to next message
Laurent Fasani is currently offline Laurent FasaniFriend
Messages: 182
Registered: October 2014
Senior Member
Hello

The behavior you have is normal because when you click on the operator node, the context is the operator. So in this case, you need to change the context to the block before creating your instance of Port

You may use a switch/case model operation:

Switch
--case : aql:self.oclIsKindOf(Block)
---- Create Instance port
--case : aql:self.oclIsKindOf(Operator)
---- Change context: aql:self.eContainer() (supposing that the operator is contained in the block)
------Create Instance port

best regards


Laurent Fasani - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Create a node by Selecting a different container [message #1832019 is a reply to message #1831989] Sat, 05 September 2020 14:40 Go to previous message
Fares G is currently offline Fares GFriend
Messages: 3
Registered: September 2020
Junior Member
Works Perfectly. Thnak you.
Previous Topic:Programmatically create instances
Next Topic:How to use generated editor as a plugin
Goto Forum:
  


Current Time: Wed Apr 24 15:50:38 GMT 2024

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

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

Back to the top