Relation-Based Edges Path Format [message #1775739] |
Sat, 04 November 2017 19:36 |
Utku Demir 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 |
|
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 |
Utku Demir Messages: 8 Registered: October 2017 |
Junior Member |
|
|
Pierre-Charles David wrote on Mon, 06 November 2017 07:52Hi,
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
|
|
|
|
Powered by
FUDForum. Page generated in 0.03167 seconds