Skip to main content



      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 14:18 Go to next message
Eclipse UserFriend
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 05:09 Go to previous messageGo to next message
Eclipse UserFriend
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
Re: Create a node by Selecting a different container [message #1832019 is a reply to message #1831989] Sat, 05 September 2020 10:40 Go to previous message
Eclipse UserFriend
Works Perfectly. Thnak you.
Previous Topic:Programmatically create instances
Next Topic:How to use generated editor as a plugin
Goto Forum:
  


Current Time: Sun Jun 15 02:42:49 EDT 2025

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

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

Back to the top