Skip to main content



      Home
Home » Eclipse Projects » Sirius » Problem with target mapping in a simple diagram extension
Problem with target mapping in a simple diagram extension [message #1739537] Tue, 02 August 2016 14:01 Go to next message
Eclipse UserFriend
Hi,

I played around with diagram extensions, and my goal was to introduce additional edges that can be drawn between classes in a UML class diagram. So I created the following meta model:

https://drive.google.com/uc?export=download&id=0B1-js5uA8MEtX1lncTJSR3lJNTQ

The EClass ClassConnector is the domain class of my element-based edge for connecting two UML classes. I used the generator model to generate the management code for this meta model.

For the diagram extension, I did the following:

  • I created a viewpoint (Model File Extension: "xmi")
  • In the viewpoint, I created a diagram extension (Viewpoint URI: "viewpoint:/org.obeonetwork.dsl.uml2.design/Design", Representation Name: "Class Diagram")
  • In the diagram extension, I created a new layer
  • In the layer, I created an element-based edge with some style and the following properties:

    https://drive.google.com/uc?export=download&id=0B1-js5uA8MEtQWZhb3lRd0l5dTA

  • In the layer, I created a tool section
  • In the tool section, I created an edge creation tool pointing to the mentioned edge element

The problem that I have is that the edge creation tool works fine for the source class ...
https://drive.google.com/uc?export=download&id=0B1-js5uA8MEtcW0wWFV4SmkzT00

... but it prevents me from setting the target class:
https://drive.google.com/uc?export=download&id=0B1-js5uA8MEtWFVtTDJoTUpqR2c

Where is the error in this example? If I add a connection directly to the model instance (XMI file) in the reflective editor, I get the expected result (that is, an edge is drawn between the classes).

Regards,
Michael
Re: Problem with target mapping in a simple diagram extension [message #1739602 is a reply to message #1739537] Wed, 03 August 2016 04:45 Go to previous messageGo to next message
Eclipse UserFriend
Hello

Fisrt of all, I have some remarks. You said :"I created a viewpoint (Model File Extension: "xmi")" . If you created a new VSP (viewpoint specific project) that contains a VSM or a new VSM inside your modeling project, both VSM should have an odesign extension file.(the file struture is xmi)

Now, globally, what you did seems correct.
Nevertheless, make sure that :
*on your edge creation tool, you have not an incorrect "Connection Complete Precondition"
* you added some operations under the Begin node. Typically you should have "Create Instance" and "Set"s operations to create a ClassConnector and to set source and target features

Regards
Laurent
Re: Problem with target mapping in a simple diagram extension [message #1739614 is a reply to message #1739602] Wed, 03 August 2016 05:33 Go to previous message
Eclipse UserFriend
Hi Laurent,

you were absolutely right, I had to add some operation under the Begin node (a simple Change Context was enough for testing purposes to get the mouse indicator right). I thought that an empty Begin node would simply do nothing at confirmation, but obviously it also effects the selection of the target node.

For the sake of completeness, the "Connection Complete Precondition" was empty.

Thank you very much!

Regards,
Michael
Previous Topic:Context menu
Next Topic:Tree diagram with tabbed properties
Goto Forum:
  


Current Time: Sat Mar 15 11:06:12 EDT 2025

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

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

Back to the top