Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Problem to create node from palette(Working for some nodes but not every nodes)
Problem to create node from palette [message #1824297] Mon, 13 April 2020 15:01 Go to next message
Léo Cauvin is currently offline Léo CauvinFriend
Messages: 12
Registered: April 2020
Junior Member
Hi,

You can see my metamodel below (babyidm.jpg) and a screenshot of my .odesign.
My problem is : I don't succeed to create a "Protection" node from the palette, but i can create "Stream" "DataBlock" and "Key". I don't know why. I proceeded the same way as the 3 others.
Could someone tell me where is my mistake ?

Thanks
Léo

  • Attachment: babyidm.jpg
    (Size: 518.45KB, Downloaded 37 times)
  • Attachment: odesign.png
    (Size: 157.74KB, Downloaded 22 times)
Re: Problem to create node from palette [message #1824446 is a reply to message #1824297] Wed, 15 April 2020 12:20 Go to previous messageGo to next message
Nicolas Vannier is currently offline Nicolas VannierFriend
Messages: 3
Registered: April 2020
Junior Member
The "infos" feature belongs to an "information" object in your model, so I think your tool should be applied on an "information" object and not on the main object.
Re: Problem to create node from palette [message #1824459 is a reply to message #1824446] Wed, 15 April 2020 15:53 Go to previous messageGo to next message
Léo Cauvin is currently offline Léo CauvinFriend
Messages: 12
Registered: April 2020
Junior Member
Thanks for your reply.
Which tool are you talking about ? Section tool ? I don't understand how to apply it somewhere else.
Re: Problem to create node from palette [message #1824471 is a reply to message #1824459] Wed, 15 April 2020 18:37 Go to previous messageGo to next message
Avi Shaked is currently offline Avi ShakedFriend
Messages: 116
Registered: October 2019
Senior Member
Seems like you first need to change context to the specific "information" element (not just to deatures "infos" which may point to several entities). Since the "protection" node is an element that needs to be contained within a specific "information" node (because of the composition relationship), you first need to navigate to that specifi "information" node (or specify it othewise, and make sure you have created such node befoe the "information" node").
Re: Problem to create node from palette [message #1824502 is a reply to message #1824471] Thu, 16 April 2020 12:25 Go to previous messageGo to next message
Nicolas Vannier is currently offline Nicolas VannierFriend
Messages: 3
Registered: April 2020
Junior Member
When you select a tool in the palette you then have to click somewhere to apply it, I assume you apply it on the diagram background which would be the "main" object, there is no problem with that but as Avi said the "protection" node is contained by an "information" node, however the "main" object contains many "information" nodes ( or none ), so applying the tool on the "main" object without specifying which "information" node is targeted will not work, so as I said before the proper pattern would be to apply the tool on the "information" node that is targeted to begin with.
Re: Problem to create node from palette [message #1824503 is a reply to message #1824471] Thu, 16 April 2020 12:43 Go to previous messageGo to next message
Léo Cauvin is currently offline Léo CauvinFriend
Messages: 12
Registered: April 2020
Junior Member
Thank you Avi. I understood what you said but do you know how can i navigate to a a specific Information( Stream for exemple) ?
I tried to do something but it's not working (in attachment)
Re: Problem to create node from palette [message #1825004 is a reply to message #1824503] Fri, 17 April 2020 12:47 Go to previous messageGo to next message
Léo Cauvin is currently offline Léo CauvinFriend
Messages: 12
Registered: April 2020
Junior Member
Yes you are right Nicolas, I was applying it to the background, but I can't apply it to a specific information (see the attachment). That's why I think my .odesign isn't good.
Re: Problem to create node from palette [message #1826106 is a reply to message #1824503] Sun, 19 April 2020 17:40 Go to previous messageGo to next message
Avi Shaked is currently offline Avi ShakedFriend
Messages: 116
Registered: October 2019
Senior Member
yes.
In the create instance properties you can see variable name = instance. You may change it or leave it as it is ("instance").
Then, you need to add another "change context" operation below the "create instance" operation (by right clicking ...). You then use "var: instance" or "aql: instance" for the change context browse expression (in the properties window).

Please let me know you managed it.

Regards,
Avi

P.S. If you wanted to change the context to another entity, and not the newly created one, you may use the "set" operation to declare a variable and then use "change context" operation, or just enter any AQL query for the change context browse expression.

[Updated on: Sun, 19 April 2020 17:42]

Report message to a moderator

Re: Problem to create node from palette [message #1826149 is a reply to message #1826106] Mon, 20 April 2020 09:57 Go to previous messageGo to next message
Léo Cauvin is currently offline Léo CauvinFriend
Messages: 12
Registered: April 2020
Junior Member
I renamed the variable name of the create instance of NewProtection as "protec". And then I added below a Change Context with "var:protec" (screenshot2.png).
I saved the .odesign but nothing changed on my diagram. I cannot add a protectionNode to a Key, Stream or DataBlock. In fact, it proposes me to create a protection only when I click on the background (main object), and it still doesn't work(4th icon above the cursor on screenshot.png).

Thanks for helping me
Re: Problem to create node from palette [message #1826185 is a reply to message #1826149] Mon, 20 April 2020 17:55 Go to previous messageGo to next message
Avi Shaked is currently offline Avi ShakedFriend
Messages: 116
Registered: October 2019
Senior Member
Hi,

I can see the problem. If I had the odesign I could have commented better, but I will attempt to suggest some help:
Verify the type that the createProtection tool is applied to (. It needs to be applied to a specific information element (and if not, then you should at least navigate to a specific information element from from the element it is applied to). I do not see it in your tool (Screenshot2).
Specifically, it looks like you are applying the tool a Main element, from there you navigate to a System element (which hopefully was already created, otherwise navigation won't work). Then, from there you navigate to "infos", which is NOT a specific information element. You need to navigate to a specific information instance.

I would suggest that you:
1. try to change the first "change context" to var: container (so that you'll start from the element you clicked on).
2. Assuming the element you clicked on is typed "system" (i.e., the diagram is a representation of system; if it's a representation of another element let me know), create an information element.
3. After the information element creation, in the same tool, change context to the information element you just created and only then create a protection element.
If this works for you, we can continue.
Re: Problem to create node from palette [message #1826222 is a reply to message #1826185] Tue, 21 April 2020 11:20 Go to previous messageGo to next message
Léo Cauvin is currently offline Léo CauvinFriend
Messages: 12
Registered: April 2020
Junior Member
Hi,
here is my .odesign.
I don't know if I was clear at the beginning but my aim is to let the user do these things :

  • create new keys, streams or datablock
  • add protection to each one of these nodes (by selecting protection in the palette and clicking on it)

The system node is already created before and yes it's its representation (but I choose a "main" root to see the system node).
I tried to do what you said but I have a problem, I don't know what to write in the reference name of the Create Instance Information, there is no auto-completion when I choose "var:container" in the change context above it.

Thanks

Léo
Re: Problem to create node from palette [message #1826231 is a reply to message #1826222] Tue, 21 April 2020 15:33 Go to previous messageGo to next message
Avi Shaked is currently offline Avi ShakedFriend
Messages: 116
Registered: October 2019
Senior Member
I don't see the tools in the .odesign file you attached.

Anyway, you seem to be on the way. The first change context is good, provided that the tool is applied to a key, stream or datablock.
The reference name (which you left empty) of the first "create instance" should be "protection" (which is the name of the reference between Information to Protection in your ecore metamodel). Also, the type name should be babyidm::Protection (and not information. The key/stream/datablock element on which the tool is applied inherit "information").
Then, you can remove the second "create instance" (because you already created the element). There is no need for the second "change context" as well, unless you want to make any changes to the protection element you just created (but you can leave it as a provision for).
Re: Problem to create node from palette [message #1826487 is a reply to message #1826231] Sat, 25 April 2020 18:34 Go to previous messageGo to next message
Léo Cauvin is currently offline Léo CauvinFriend
Messages: 12
Registered: April 2020
Junior Member
I did what you said but it still doesn't work (same result as before).
As you can see in the screenshot4 I didn't use the "var:container" for my other create instance so maybe the problem comes from here ? I never succeeded to instantiate object with this var:container (except when I did the StarterTutorial of Sirius).
Thanks
Re: Problem to create node from palette [message #1826534 is a reply to message #1826487] Sun, 26 April 2020 17:41 Go to previous messageGo to next message
Avi Shaked is currently offline Avi ShakedFriend
Messages: 116
Registered: October 2019
Senior Member
can you share the exact definition of the entire node creation tool and the node representation associated with it?
Re: Problem to create node from palette [message #1826537 is a reply to message #1826534] Sun, 26 April 2020 18:38 Go to previous messageGo to next message
Léo Cauvin is currently offline Léo CauvinFriend
Messages: 12
Registered: April 2020
Junior Member
You can see them in attachments, do you need anything else ?
Thank you for spending time on this to help me.
  • Attachment: node.png
    (Size: 80.70KB, Downloaded 11 times)
  • Attachment: createNode.png
    (Size: 84.85KB, Downloaded 11 times)
Re: Problem to create node from palette [message #1826775 is a reply to message #1826537] Thu, 30 April 2020 09:24 Go to previous messageGo to next message
Avi Shaked is currently offline Avi ShakedFriend
Messages: 116
Registered: October 2019
Senior Member
In the Node Creation Protection, select Advanced tab and try to add all elements (or element you want to have protection: Stream, DataBlock, Key).
I believe this should solve the problem.
Anyway, I am attaching an implementation based on the metamodel you provided. I tested it and it works: click on an existing Stream element after you selected the ""Protection" tool and you will see new protection element on the diagram, and as a component of the selected stream element.
Re: Problem to create node from palette [message #1826814 is a reply to message #1826775] Fri, 01 May 2020 08:59 Go to previous messageGo to next message
Léo Cauvin is currently offline Léo CauvinFriend
Messages: 12
Registered: April 2020
Junior Member
I added my 3 nodes Key/Strem/DataBlock into Extra Mappings in advanced tab of the node creation Protection and it's working !!
The result is exactly what I expected.
Thank you so much for your help !
Re: Problem to create node from palette [message #1826841 is a reply to message #1826814] Sat, 02 May 2020 05:44 Go to previous messageGo to next message
Avi Shaked is currently offline Avi ShakedFriend
Messages: 116
Registered: October 2019
Senior Member
Great to hear!
Re: Problem to create node from palette [message #1831881 is a reply to message #1826185] Tue, 01 September 2020 18:01 Go to previous message
Fares G is currently offline Fares GFriend
Messages: 3
Registered: September 2020
Junior Member
Hi,
I have a similar problem that I will try to explain usinf this example.
Let's suppose the protection is included in system.. and I want to create a new protection associated to the system by clicking on a key or stream.
In other words, by clicking on the key, a protection associated to the system of the clicked key is created. ( I want to click on a node, but this node is not the container)
I hope It's clear, otherwise I will implement something similar to get a better understanding of the problem.

Thank you
Previous Topic:Avoiding multiple representations of an element in diagram
Next Topic:Open sirius PropertySheet from a Table editor
Goto Forum:
  


Current Time: Wed Oct 28 12:39:51 GMT 2020

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

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

Back to the top