Skip to main content



      Home
Home » Eclipse Projects » Sirius » Diificulties to create a node
Diificulties to create a node [message #1791165] Mon, 25 June 2018 08:03 Go to next message
Eclipse UserFriend
Hi all I am trying to realize an editor for my domain.
HI did all the tutorial from Obeo, but I cannot resolve my problem.

The first image laCen.png contains my model.

The second image the description of how I try to add to the tool a create node for the workstation object.

But this doesnot work I have when i drag the node to the diagram the foolwing error:

org.eclipse.sirius.ecore.extender.business.api.accessor.exception.FeatureNotFoundException: workstations on laCen.impl.CustomerImpl@3b4aeacd (name: Workstation n°)

Can you help me?

Regards

Antonio


  • Attachment: laCen.png
    (Size: 747.18KB, Downloaded 243 times)
  • Attachment: laCen2.PNG
    (Size: 19.89KB, Downloaded 211 times)
Re: Diificulties to create a node [message #1791170 is a reply to message #1791165] Mon, 25 June 2018 08:56 Go to previous messageGo to next message
Eclipse UserFriend
Hello

It is not so easy to answer precisely without you odesign file.
What happen is that somewhere in your tool, your current self or the variable you use is a instance of Customer that you consider as an instance of Organization. I guess it because you try to modify the Organization.workstations feature.

Regards
Laurent
Re: Diificulties to create a node [message #1791177 is a reply to message #1791170] Mon, 25 June 2018 09:39 Go to previous messageGo to next message
Eclipse UserFriend
I will precise my pb:

Imagine I have A ->B->C. A here is the Customer. I build my tool to create object under A (Customer). To createNode for B (Organisation) it's easy , I write for change context var:container and for reference name: organisations.

But now I want createNode for Workstation. I canoot put for change context var:container (it's customer). But how can I write to tell object is Organisation to use the workstations Elist???????


This is never explain because examples are always very simple using A and B no more.

Thanks for your help
Re: Diificulties to create a node [message #1791227 is a reply to message #1791177] Tue, 26 June 2018 06:27 Go to previous messageGo to next message
Eclipse UserFriend
I think you should use the Sirius Interpreter and by try &error using aql:self.eContainer() / aql:self. eContens() / etc. find out, what to write to get the intended objectlist.
Re: Diificulties to create a node [message #1791367 is a reply to message #1791227] Thu, 28 June 2018 08:13 Go to previous messageGo to next message
Eclipse UserFriend
container variable depends on the selection so if your select an Organisation then container is a Organisation. but you can also select a Customer. In this case you have implement the logic for getting the right Organisation instance. For example a trivial implementation is aql:self.organisations->at(1)
Make sure also that you selected the right mapping on your NodeCreationDescription.

regards
Laurent
Re: Diificulties to create a node [message #1791378 is a reply to message #1791367] Thu, 28 June 2018 09:10 Go to previous message
Eclipse UserFriend
In your metamodel, Workstation is linked to Organisation via a composition. It means that when you create a new Workstation it must be attached to an existing Organisation.

If Workstations and Organisations are displayed with Nodes linked with Edges (see orga-node.png) you will have a problem with your creation tool : if the user click on the diagram background, you don't know to which Organisation the new Workstation should be attached (you have to select an arbitrary Organisation, for example the first one, which is not intuitive for the end user of your tool).

To represent Organisations, I suggest that you replace the Node by a Container containing Workstation nodes (see orga-container.png) . Then your tool will know which organisation is the owner = the one on which the user has clicked. The expression of the ChangeContext becomes very simple "var:self" (see odesign.png).

[Updated on: Thu, 28 June 2018 09:16] by Moderator

Previous Topic:[ANN] Sirius 6.0.0
Next Topic:Cannot use "Unset" operation on attributes
Goto Forum:
  


Current Time: Wed Jul 23 01:45:44 EDT 2025

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

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

Back to the top