Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Relation Based Edge with Sirius
Relation Based Edge with Sirius [message #1785245] Wed, 11 April 2018 12:47 Go to next message
WINNER WINNER is currently offline WINNER WINNERFriend
Messages: 22
Registered: March 2018
Junior Member
Hi,

Can you please help me to define the OCL constraint that i should make to determine the target element from the source one.

My Ecore model is uploaded.

I want to define a relation between Stations as an edge.

Regards

Re: Relation Based Edge with Sirius [message #1785553 is a reply to message #1785245] Mon, 16 April 2018 14:58 Go to previous messageGo to next message
Pierre Guilet is currently offline Pierre GuiletFriend
Messages: 160
Registered: June 2017
Senior Member
Hi,

From your metamodel it seems to me that an element based edge seems more adapted.

Indeed it is the Arc concept that contains the relation associating a station to another. From the Arc it is easy to have the source and target (aql:self.fromN and aql:self.toN).

With a relation based edge, you have to cross your model to retrieve the container of the source station then iterate on all arcs to find the one with as source the source station and then to return the associated station from this arc instance.
This will be much more complicated in AQL than from an element based edge .

Also don't hesitate to use Java services if you are not familiar with AQL language for more complicated expression :
https://www.eclipse.org/sirius/doc/specifier/general/Writing_Queries.html#service_methods
It allows you to use EMF APIs

If you still want to go that way I suggest you to read AQL documentation available at https://www.eclipse.org/acceleo/documentation/aql.html or in your help environment in Help>Help Content>Acceleo Query Language Documentation

But it should look something like :
aql:self.eContainer().arc->any(arcTemp|arcTemp.fromN=self).oclAsType(yourMetamodel::Arc).toN

Also don't hesitate to use the interpeter view to test your expression:
https://www.eclipse.org/sirius/doc/specifier/general/Writing_Queries.html

Regards,


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

[Updated on: Mon, 16 April 2018 15:21]

Report message to a moderator

Re: Relation Based Edge with Sirius [message #1786688 is a reply to message #1785553] Wed, 09 May 2018 12:58 Go to previous messageGo to next message
WINNER WINNER is currently offline WINNER WINNERFriend
Messages: 22
Registered: March 2018
Junior Member
Hello,

Not yet resolved

Regards
Re: Relation Based Edge with Sirius [message #1786786 is a reply to message #1786688] Fri, 11 May 2018 14:19 Go to previous message
Pierre Guilet is currently offline Pierre GuiletFriend
Messages: 160
Registered: June 2017
Senior Member
Hello,

Can you be more specific please?

Regards,


Pierre Guilet - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Previous Topic:I canĀ“t create Relationship edge
Next Topic:How to increment an id feature automatically
Goto Forum:
  


Current Time: Thu Sep 20 07:35:34 GMT 2018

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

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

Back to the top