Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Create Relation Edge through JAva Service
Create Relation Edge through JAva Service [message #1763544] Wed, 17 May 2017 09:05 Go to next message
Paul Aubry is currently offline Paul AubryFriend
Messages: 9
Registered: March 2017
Junior Member
Hello,

Here is my problem : I would like to draw a link between two elements of my model by using java Services.

My case is a little complicated but I will try to make it seems easier...

I have 2 elements E1 and E2.
if I dig during a few moment, I can find a link between them (following the tree and found out 1shared branch).

I want to find this branch but using a java Service and I want only create the link between E1 and E2 (I don't want to show other branches)

My question is : How should I do to connect the Elements together where they don't have direct link?

Thanks for your answer!
Re: Create Relation Edge through JAva Service [message #1763637 is a reply to message #1763544] Thu, 18 May 2017 09:21 Go to previous messageGo to next message
Laurent Fasani is currently offline Laurent FasaniFriend
Messages: 182
Registered: October 2014
Senior Member
Hello

You can simply do a "Relation Base Edge" [1]
The "Target Finder Expression" is used to provide the target semantic elements of the node corresponding to the Target Mapping. You can call a java service is the logic to get the taget elements is complex.
For example, if you have a node mapping representing your class E, in your diagram you will have NodeE1 and NodeE2 instances representing E1 and E2(semantic elements instances)
To have a connection between NodeE1 and NodeE2, the "Target Finder Expression", starting from E1 as self variable, must provide E1 as target semantic element.

regards
Laurent


[1] http://help.eclipse.org/neon/topic/org.eclipse.sirius.doc/doc/specifier/diagrams/Diagrams.html#edges


Laurent Fasani - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Create Relation Edge through JAva Service [message #1763642 is a reply to message #1763637] Thu, 18 May 2017 09:43 Go to previous messageGo to next message
Paul Aubry is currently offline Paul AubryFriend
Messages: 9
Registered: March 2017
Junior Member
Laurent,
Thanks for your answer!

But I think I don't really understand the last part of your answer... the target Finder Expression but define the exact link between my 2 node, isn't it? because here is my problem : the link is very special and a little complex to be found with an aql query (if I should write this kind of query)...
Re: Create Relation Edge through JAva Service [message #1763850 is a reply to message #1763642] Mon, 22 May 2017 08:04 Go to previous messageGo to next message
Paul Aubry is currently offline Paul AubryFriend
Messages: 9
Registered: March 2017
Junior Member
In these 2 pictures, you can see what I really want to do.

In fact, in the "WhatIHave.png", there are 4 entities I don't want to show (or to package them in a black-box) to have "WhatIWant.png" picture.

Do you have an idea on how to do this?

Thanks a lot!
Re: Create Relation Edge through JAva Service [message #1764079 is a reply to message #1763850] Wed, 24 May 2017 15:00 Go to previous messageGo to next message
Maxime Porhel is currently offline Maxime PorhelFriend
Messages: 516
Registered: July 2009
Location: Nantes, France
Senior Member
Hi Paul,

As suggested by Laurent, you simply have to create an EdgeMapping to simulate this "complex" relation.
There are two options

The first one consists in creating a RelationBaseEdge between your list mappings and use a JavaService to navigate the model from the one you will choose as source mapping to the target element. Note that the displayed direction is simply a configuration of the edge, you can choose to display the arrow on the source or on the targe (or ven both). You have maybe a direction which will be simpler to compute.

The other solution consists in the creation of an ElementBasedEdge, based on one of the non displayed element (the functional exchange for example), you will need to be able to provide a query (semantic candidates of the mapping) to retrieve them from the semantic element used as diagram root (or you can keep it empty but it will navigate the whole model to find the candidates). Then from the exchange, you will have to write two queries or JavaService to retireve the source or the target. Which can be esaier to compute than the relation from the source to the target.

Note that you can get the semantic cross referencer of the session (or maybe reuse yours if you have your own cross referencer) to retrieve an element which references another one if their is no eOpposite reference.

Regards,

Maxime
Re: Create Relation Edge through JAva Service [message #1764080 is a reply to message #1764079] Wed, 24 May 2017 15:01 Go to previous messageGo to next message
Maxime Porhel is currently offline Maxime PorhelFriend
Messages: 516
Registered: July 2009
Location: Nantes, France
Senior Member
Hi Paul,

As suggested by Laurent, you simply have to create an EdgeMapping to simulate this "complex" relation.
There are two options

The first one consists in creating a RelationBaseEdge between your list mappings and use a JavaService to navigate the model from the one you will choose as source mapping to the target element. Note that the displayed direction is simply a configuration of the edge, you can choose to display the arrow on the source or on the targe (or ven both). You have maybe a direction which will be simpler to compute.

The other solution consists in the creation of an ElementBasedEdge, based on one of the non displayed element (the functional exchange for example), you will need to be able to provide a query (semantic candidates of the mapping) to retrieve them from the semantic element used as diagram root (or you can keep it empty but it will navigate the whole model to find the candidates). Then from the exchange, you will have to write two queries or JavaService to retireve the source or the target. Which can be esaier to compute than the relation from the source to the target.

Note that you can get the semantic cross referencer of the session (or maybe reuse yours if you have your own cross referencer) to retrieve an element which references another one if their is no eOpposite reference.

Regards,

Maxime
Re: Create Relation Edge through JAva Service [message #1764582 is a reply to message #1764080] Wed, 31 May 2017 13:20 Go to previous message
Paul Aubry is currently offline Paul AubryFriend
Messages: 9
Registered: March 2017
Junior Member
thanks for your answer.

Can you tell me what should be the "return type" of the Java Service? I explain what I need to know : all the services I use are like tjis :

public boolean IsUsefull(CapellaElement self) {
if (self instanceof "WhatIWant"){
return true;
}
return false;
}


this code show the element if it is a part of "whatIWant" type. How should be written the service I can use to draw the relation Edge...?

Thanks
Previous Topic:Disable Sirius tools programmatically
Next Topic:Create diagram editor
Goto Forum:
  


Current Time: Tue Oct 08 00:45:11 GMT 2024

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

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

Back to the top