Skip to main content



      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 04:13 Go to next message
Eclipse UserFriend
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 15:05 Go to previous messageGo to next message
Eclipse UserFriend
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
Re: Why the editor I created cannot display relation based edges? [message #1851961 is a reply to message #1851956] Sat, 23 April 2022 03:13 Go to previous message
Eclipse UserFriend
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 Apr 20 00:36:00 EDT 2025

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

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

Back to the top