Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » [RESOLVED] Label AQL statement problem(Not sure how to title this error as it is pretty specific)
[RESOLVED] Label AQL statement problem [message #1769354] Sun, 30 July 2017 18:54 Go to next message
sonny selhorst is currently offline sonny selhorstFriend
Messages: 60
Registered: May 2015
Member
Dear reader,

First of all, thank you for taking the time to read this, it is much appreciated.

I am making a tool with which someone can make EER diagrams with UML notation for my master thesis. I have almost no experience with Java, so the professor that guides me decided that it would be a good idea to have me test if it is truly so that you don't need any programming experience to make use of the Sirius platform.

In EER with UML notations, it is needed to add multiplicities to the relationships in the form of "role [0..1]". I have modelled all this in my meta-model as you can see it in the annex. [1]

I then specified how the multiplicities should appear in the model with the following aql statement for my begin and end labels:

BEGINLABEL: aql:self.source.connectedRole.name+' ['+self.source.connectedRole.lowerBound+'..'+self.source.connectedRole.upperBound+']'

ENDLABEL: aql:self.target.connectedRole.name+' ['+self.target.connectedRole.lowerBound+'..'+self.target.connectedRole.upperBound+']'

Now, this all went well until I added a new bi-directional relationship to an entity which was already connected to another bi-directional relationship. Then, the begin and endlabels were concatenated. (you can see a before [2] and after [3] in the annex)

Let me explain by my diagram example:
As you can see, Employee is connected with Department by the relationship "WorksFor", it has two roles: "worker" and "dep".

Department is then again connected to Equipment by the relationship "Has", this again has two roles "owningDepartment" and "usedEquipment"

So we have the following collections:
BinaryRelationship WorksFor has two roles [worker,dep]
BinaryRelationship Has has two roles [owningDepartment,usedEquipment]
Entity Department has two connectedRoles [dep, owningDepartment]

When using the my aql statement, logically, owningDepartment and dep got concatenated.

I would want to have it so that the labels display the roles that are unique to the relationship. So for example the relationship WorksFor has [worker,dep] and Entity Department has [dep, owningDepartment], the value of the label should be dep, as that is the one that is connected to the relationship.

I have tried a lot of different AQL statements, I have read the guide a couple of times now, but cannot find any solution.

I have also added all my sirius files in a zip-file.

I am sorry if I was unclear at any point. I thank you for your insights.

Kind regards,

Sonny

[1]metamodel.png
[2]DIAGRAM_BEFORE.png
[3]DIAGRAM_AFTER.png

[Updated on: Fri, 04 August 2017 19:06]

Report message to a moderator

Re: Label AQL statement problem [message #1769548 is a reply to message #1769354] Tue, 01 August 2017 13:33 Go to previous messageGo to next message
Julien Dupont is currently offline Julien DupontFriend
Messages: 162
Registered: July 2009
Senior Member
Hi Sonny,

To have what you want you can use the ->sep(,). For example: aql:self.target.connectedRole.name->sep(',')+' ['+self.target.connectedRole.lowerBound+'..'+self.target.connectedRole.upperBound+']'
To help you, please visit https://www.eclipse.org/acceleo/documentation/aql.html

Regards,
Re: Label AQL statement problem [message #1769549 is a reply to message #1769548] Tue, 01 August 2017 14:01 Go to previous message
sonny selhorst is currently offline sonny selhorstFriend
Messages: 60
Registered: May 2015
Member
Dear Julien,

Thank you for your response. I am afraid that that's not what I was looking for to solve this problem, it will help me with other things though, so thank! The problem is in the way that I use my aql statement. I have gone through the AQL documentation multiple times now and did not find a solution.

Maybe I could try to clarify somewhat more:
There is an entity (a container) named Department which has 2 edges connected to it, "WorksFor" and "Has".
At each of these ends, there is a role (end/begin label), which is uniquely bound to the edge and entity. For simplicity, I will only involve the role name from now on:

connectedRoles for Department:
dep
owningDepartment
So here we have a collection A = {dep, owningDepartment}

Now, we also know that edge "WorksFor" has the following roles:
worker
dep

so we have a collection B={worker,dep}

Then I have for example my target for the relationship "WorksFor", which is "Department", the target label should then be the value that appears in collection A AND B, which is "dep".

I hope I was clear now, again, thank you so very much for your help.

Have a great day.

Kind regards,
Sonny
Previous Topic:Element selection in Open Dialog
Next Topic:[RESOLVED] Open Dialog - Reference
Goto Forum:
  


Current Time: Sat Mar 28 22:04:32 GMT 2020

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

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

Back to the top