AQL element creation difficulties [message #1746209] |
Tue, 25 October 2016 10:11 |
Emil Jenotte 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 |
|
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 |
Emil Jenotte 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
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03865 seconds