I want to define a (edge creation) tool that creates two additional sockets on the entities that are to be connected by an element based edge. I'm not able to set the endpoints of the edge as I don't know how to refer to the newly created sockets.

So the domain model contains entities named Node, Socket and Edge. Nodes contain Sockets and Edges refer to sockets for their ednpoints.

The tool should accept two nodes as source and target. Upon invocation, the tool should create a Socket contained by the source a Socket contained by the target. Then, it should create an Edge and let its endpoints refer to the newly created Sockets.

In the properties of the Create Socket instance operations, I defined variable names for the new instances (sourceSocket and targetSocket). When trying to refer to these while setting the endpoints value of the Edge, the system complaints with: unknown variable: sourceSocket.

It seems that the visibility of sourceSocket is limited to the scope of Create instance.

How can I refer to these instances later on. Or should I structure my tool definition in a different way?

I checked with other Sirius commiters, and this is actually the expected
behavior. User-defined variables (such as variables defined inside a
CreationTool) are only visible for children, so what you describe as an
issue is actually the expected behavior.

While writing Operations on Tool, remember that any slibing instruction
should be executable before or after its other slibings. If an
instruction depends on another, it should be contained in it.

It would have been nice if this concept would be explained in the documentation of the tool operations. Especially this sentence is misleading (quoted from the help information of Create Instance):

Quote:

The Variable Name property can be set to any valid variable name ( instance by default). The named variable is assigned with the newly created object, so that it can be accessed from the remaining operations in the tool.