Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Why the editor I created cannot display relation based edges?
Why the editor I created cannot display relation based edges? [message #1851798] Sat, 16 April 2022 08:13 Go to next message
Su Su is currently offline Su SuFriend
Messages: 2
Registered: April 2022
Junior Member
I tried to follow Sirius' BasicFamily's tutorial to create a family relationship modeling tool. The members are displayed properly, but their relationship linkage is not displayed (father's edge and mother's edge).
In order to explore what I did wrong, I used the sample BasicFamily metamodel project provided by Sirius again to base the modeling tool design on it. It was able to display the relational edge between members properly.
So I deduced that I might have built my metamodel wrong. I then copied the elements of the sample BasicFamily metamodel provided by Sirius directly on the metamodel builder diagram and regenerated the edit and editor, but the relationships between family members were still not displayed in the modeling tool.
I couldn't figure out why. Then I followed the tutorial again to create it, but still had the same problem.
Here are some screenshots of my design.
index.php/fa/41929/0/
index.php/fa/41931/0/
index.php/fa/41928/0/
index.php/fa/41930/0/
Re: Why the editor I created cannot display relation based edges? [message #1851956 is a reply to message #1851798] Fri, 22 April 2022 19:05 Go to previous messageGo to next message
Steve Monnier is currently offline Steve MonnierFriend
Messages: 566
Registered: May 2011
Senior Member
Hello,

Can you check the class com.obeodesigner.sample.family.impl.PersonImpl.getFather() from your version of the metamodel. As it is a derived reference, you need to write the code on how to reference this. In the provided metamodel, you will have this:

/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Man getFather() {
Man father = basicGetFather();
return father != null && father.eIsProxy() ? (Man)eResolveProxy((InternalEObject)father) : father;
}

/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated NOT
*/
public Man basicGetFather() {
if (!getParents().isEmpty()) {
for (Person parent : getParents()) {
if (parent instanceof Man) {
return (Man) parent;
}
}
}
return null;
}

Maybe your version is missing the second method (generated NOT) that filters the getParents() method to keep only Man element. Of course, you need the same for the morther reference.

Best regards,
Steve


Steve Monnier - Obeo Canada
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Why the editor I created cannot display relation based edges? [message #1851961 is a reply to message #1851956] Sat, 23 April 2022 07:13 Go to previous message
Su Su is currently offline Su SuFriend
Messages: 2
Registered: April 2022
Junior Member
Thank you!
I have wrote the code above in the file named PersonImpl.java, and now it works!
Previous Topic:Does the Property View Sirius Specifier work in Capella ? Yes or No?
Next Topic:Flow page moved halfway across the node
Goto Forum:
  


Current Time: Sun Aug 07 16:25:53 GMT 2022

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

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

Back to the top