Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Relation-Based Edges Path Format(Path Expression / Path Mapping)
Relation-Based Edges Path Format [message #1775739] Sat, 04 November 2017 19:36 Go to next message
Utku Demir is currently offline Utku DemirFriend
Messages: 8
Registered: October 2017
Junior Member
Hi guys ,
I wonder if you can help me with the problem.
I want to create a relation based edge between Client and WebService. But I don't want to use connectsTo reference as Target Finder Expression. I want to reach specific WebService where my Client uses a EndPoint of that WebService. To be more clear each Webservice has a child Resources and each Resources has a child EndPoint and I believe that if I use 'uses' reference to add Endpoint to any Client, I can find the parent of this EndPoint, that's why I can determine the WebService that used by Client.

So, be able to create such relation over multiple reference , I need to use Path Expression and Path Mapping in Relation-Based Edge which I don't know how. I could'nt find any example so i need your guys help.

or

If you guys have any better idea to create such relation, I'm open to new ideas



Thanks,
Utku Demir

[Updated on: Wed, 06 December 2017 22:52]

Report message to a moderator

Re: Relation-Based Edges Path Format [message #1775768 is a reply to message #1775739] Mon, 06 November 2017 07:52 Go to previous messageGo to next message
Pierre-Charles David is currently offline Pierre-Charles DavidFriend
Messages: 523
Registered: July 2009
Senior Member
Hi,

From what I understand, you don't need to use a "Path expression", but simply a more complex Target Finder Expression than just a plain reference access. Path Expressions are used to highlight series of individual edges that constitute a logical path (see for example the path in blue on https://imgur.com/a/8iIrN).

A Target Finder Expression can be an arbitrary complex navigation expression inside your model, typically written in AQL and/or in Java. If you're not familiar with AQL, the simplest is probably to write a Java services (it's just a plain Java method that needs to follow some conventions):

public Set<WebService> findWebServicesForClient(Client client) {
   // Use plain Java to navigate inside your model using the normal EMF APIs and build the result.
}


and then in the VSM, the Target Finder Expression simply needs to invoke the service (make sure its class is probably registered): service:findWebServicesForClient


Pierre-Charles David - Obeo

Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Relation-Based Edges Path Format [message #1775792 is a reply to message #1775768] Mon, 06 November 2017 12:50 Go to previous messageGo to next message
Utku Demir is currently offline Utku DemirFriend
Messages: 8
Registered: October 2017
Junior Member
Pierre-Charles David wrote on Mon, 06 November 2017 07:52
Hi,

From what I understand, you don't need to use a "Path expression", but simply a more complex Target Finder Expression than just a plain reference access. Path Expressions are used to highlight series of individual edges that constitute a logical path (see for example the path in blue on https://imgur.com/a/8iIrN).

A Target Finder Expression can be an arbitrary complex navigation expression inside your model, typically written in AQL and/or in Java. If you're not familiar with AQL, the simplest is probably to write a Java services (it's just a plain Java method that needs to follow some conventions):

public Set<WebService> findWebServicesForClient(Client client) {
   // Use plain Java to navigate inside your model using the normal EMF APIs and build the result.
}


and then in the VSM, the Target Finder Expression simply needs to invoke the service (make sure its class is probably registered): service:findWebServicesForClient


Thanks for the information.
In this case I have to create custom services for every situation that I need for any relation. It's kinda tiring job :) AQL expression would be nice if I knew how to write it. But I suppose I will keep continue to use service method. If you don't mind, can you give me a short example on how to navigate in my model using EMF APIs to be a future sample for my other relations ?

Thanks.


Thanks,
Utku Demir
Re: Relation-Based Edges Path Format [message #1775861 is a reply to message #1775792] Tue, 07 November 2017 10:44 Go to previous message
Pierre-Charles David is currently offline Pierre-Charles DavidFriend
Messages: 523
Registered: July 2009
Senior Member
Hi,

For AQL, the reference documentation is at https://www.eclipse.org/acceleo/documentation/aql.html. By "EMF APIs" I meant the Java APIs EMF has generated from your metamodel definition. In your case you will have Java classes named Client, WebServices, EndPoint, etc. with methods corresponding to the attributes of and references between these types. For example someClient.getConnectsTo() will return the WebService instances the client points to. If you're new to EMF, see https://help.eclipse.org/oxygen/topic/org.eclipse.emf.doc/references/overview/EMF.html?cp=34_0_0 for an overview of how a metamodel definition translated into Java API.

Regards,


Pierre-Charles David - Obeo

Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Previous Topic:Use External Java Action in Create Instance
Next Topic:[ANN] Sirius 5.1.0
Goto Forum:
  


Current Time: Fri Apr 10 10:42:10 GMT 2020

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

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

Back to the top