Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Diificulties to create a node
Diificulties to create a node [message #1791165] Mon, 25 June 2018 12:03 Go to next message
antonio guillen is currently offline antonio guillenFriend
Messages: 60
Registered: January 2014
Member
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 191 times)
  • Attachment: laCen2.PNG
    (Size: 19.89KB, Downloaded 190 times)
Re: Diificulties to create a node [message #1791170 is a reply to message #1791165] Mon, 25 June 2018 12:56 Go to previous messageGo to next message
Laurent Fasani is currently offline Laurent FasaniFriend
Messages: 182
Registered: October 2014
Senior Member
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


Laurent Fasani - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Diificulties to create a node [message #1791177 is a reply to message #1791170] Mon, 25 June 2018 13:39 Go to previous messageGo to next message
antonio guillen is currently offline antonio guillenFriend
Messages: 60
Registered: January 2014
Member
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 10:27 Go to previous messageGo to next message
Andreas Buchner is currently offline Andreas BuchnerFriend
Messages: 47
Registered: August 2017
Member
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 12:13 Go to previous messageGo to next message
Laurent Fasani is currently offline Laurent FasaniFriend
Messages: 182
Registered: October 2014
Senior Member
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


Laurent Fasani - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Diificulties to create a node [message #1791378 is a reply to message #1791367] Thu, 28 June 2018 13:10 Go to previous message
Frederic Madiot is currently offline Frederic MadiotFriend
Messages: 14
Registered: October 2014
Location: Nantes
Junior Member

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).


Frédéric Madiot - Obeo

Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius

[Updated on: Thu, 28 June 2018 13:16]

Report message to a moderator

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


Current Time: Fri Apr 26 00:32:22 GMT 2024

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

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

Back to the top