Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » AQL element creation difficulties
AQL element creation difficulties [message #1746209] Tue, 25 October 2016 10:11 Go to next message
Emil Jenotte is currently offline Emil JenotteFriend
Messages: 25
Registered: September 2016
Junior Member
Hello,

I have a problem with aql-calls, that technically work each for itself, but not together. The situation is the following. Please see attached the figures for an overview. My problem is: I can not create class C.
Class C and class X both implement the interface B, which is contained by A. So when I create a C instance, I have to register it at an A instance. However, in Sirius, I want C to be a bordered node of X.
So in Sirius I implemented the following (I only included the relevant variables):

1. Graphical Representation (like figure example_sirius):
Bordered C (semantic candidates expression: feature:knows_C)

2. Creation Tool
Node Creation C
> Change Context aql:self.eResource().getContents()
>> Create Istance (reference name: contains_B)

The aql-calls work each for them self: Implementation 1. works in terms of when I create the ressource manually, it does show as a bordered node of X. Implementation 2. works in term that when C is not set a bordered node, but on the same level as X, it does get created.
But how do i merge it together? Why does it not work?
Hope you can help.

Cheers,
Emil

Re: AQL element creation difficulties [message #1746220 is a reply to message #1746209] Tue, 25 October 2016 13:49 Go to previous messageGo to next message
Maxime Porhel is currently offline Maxime PorhelFriend
Messages: 516
Registered: July 2009
Location: Nantes, France
Senior Member
Hi Emil,

In your odesign file, I assume that your NodeCreation tool "C" reference the bordered node mapping "C". So Sirius allows you to use the tool when your cursor hoovers a graphical element whose mapping is MappingA (parent of your mapping "C").
So in the tool implementation, the variable "container" will be the clicked semantic element and should be an "A", you should do a ChangeContext var:container (or aql:container) instead of aql:self.eResource().getContents() which returns a list (a quick solution would be to take the first element of the list but nothing garantees that this will be the expected A element).

Regards

Maxime - Obeo
Re: AQL element creation difficulties [message #1746252 is a reply to message #1746220] Tue, 25 October 2016 23:51 Go to previous messageGo to next message
Emil Jenotte is currently offline Emil JenotteFriend
Messages: 25
Registered: September 2016
Junior Member
Hello Maxime,

thank you very much for the fast reply. I have tried your suggestion. But when I call var:container, I am calling X, because I clicked on X in order to create C - am I correct here? So I am trying to create a C instance under X, which should not work, as C is contained in A, not in X. So when I do, what you suggested (plus also changing the reference name of the "Create Instance C" to "knows_C"), the element C does indeed show - but it comes with a little red cross and I can not acess its properties when I click on it. If I do not change the reference name of the "Create Instance C" and leave it being "contains_B", then nothing happens at all)
Do you have any other ideas?

Cheers
Emil

Re: AQL element creation difficulties [message #1746260 is a reply to message #1746252] Wed, 26 October 2016 08:16 Go to previous messageGo to next message
Maxime Porhel is currently offline Maxime PorhelFriend
Messages: 516
Registered: July 2009
Location: Nantes, France
Senior Member
Hi Emil,

I missed the fact that the clicked element was a X.

So just try ChangeContext aql:container.eContainer() to retrieve the parent of X which should be a A from your MM screenshot.

Regards,

Maxime - Obeo
Re: AQL element creation difficulties [message #1746262 is a reply to message #1746260] Wed, 26 October 2016 09:15 Go to previous messageGo to next message
Emil Jenotte is currently offline Emil JenotteFriend
Messages: 25
Registered: September 2016
Junior Member
Hello Maxime,

mille mercis!!!! Thank you so much!
You just saved me. It works! Awesome!!

Cheers
Emil
Re: AQL element creation difficulties [message #1746351 is a reply to message #1746262] Thu, 27 October 2016 12:29 Go to previous message
Maxime Porhel is currently offline Maxime PorhelFriend
Messages: 516
Registered: July 2009
Location: Nantes, France
Senior Member
Hi Emil

Glad to hear that;

Regards,

Maxime - Obeo
Previous Topic:[ANN] Sirius 4.1.1
Next Topic:Sirius-Import new edges design
Goto Forum:
  


Current Time: Tue Apr 23 13:00:36 GMT 2024

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

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

Back to the top