Home » Modeling » VIATRA » Annotation of @Edge can't work
Annotation of @Edge can't work [message #1784454] |
Wed, 28 March 2018 03:42  |
Eclipse User |
|
|
|
Hi,
Today, I research on the EMF-inquery example of 'emfxcel'(https://github.com/viatra/EMF-IncQuery-Examples/tree/master/emfxcel), I found it adapt to VIATRA2(My version is 1.5.1), so I modified the suffix of query file and some dependencies. Then I found in the 'Query Results' exporer I can see the the query result, and when I "reinitialize VIATRA viewer " , only seperate student and teacher nodes are displayed in the 'Zest Graph' view, but the edges cann't be shown, Did I omit any part to be modified ?
Thanks in advance!
|
|
| |
Re: Annotation of @Edge can't work [message #1784461 is a reply to message #1784455] |
Wed, 28 March 2018 04:48   |
Eclipse User |
|
|
|
Sorry, it is hard for me to share my current verti with u, But I can describe my problem as detailed as possible, also you can get the example from https://github.com/viatra/EMF-IncQuery-Examples/tree/master/emfxcel.
Edge annotation is defined as follows:
@Edge(source = studentId, target = teacherName, label = "taughtBy")
pattern enrolledStudent(courseName, teacherName, studentId) {
find valueInNamedColumn("Courses", "Course", rowNum, courseName);
find valueInNamedColumn("Courses", "Teacher", rowNum, teacherName);
find valueInNamedColumn("Courses", "Student Identifier", rowNum, studentId);
}
Query result and zest graph are shown in attacnment.
|
|
| |
Re: Annotation of @Edge can't work [message #1784464 is a reply to message #1784462] |
Wed, 28 March 2018 05:13   |
Eclipse User |
|
|
|
student Item annotation is below,
@Item(item = id, label = "$name$")
pattern student(name, id) {
find valueInNamedColumn("Students", "First name", rowNum, firstName);
find valueInNamedColumn("Students", "Last name", rowNum, lastName);
find valueInNamedColumn("Students", "Identifier", rowNum, id);
name == eval(firstName + " " + lastName);
}
we can see it just use the student's name as the label content, that will not change object of students. And above pattern also works well. refer to attachments.
|
|
| | |
Re: Annotation of @Edge can't work [message #1790139 is a reply to message #1784476] |
Tue, 05 June 2018 15:32  |
Eclipse User |
|
|
|
Hi,
I am sorry for being so slow to reproduce the example and find the answer. The short answer is that this example does not work correctly; all current versions of VIATRA Viewers (including the version 1.5.1 you were using) does only support drawing edges between EObject instances, but does not work for plain Java models, such as Strings used in the current example. I have opened a bug in our issue tracker to look for the root cause of this issue: https://bugs.eclipse.org/bugs/show_bug.cgi?id=535568
For a bit more detail: when the original EMFxcel example was developed, Viewers had an older implementation that worked with Java Objects, but in the meantime, the internal behavior was replaced completely, and for some reason we have missed the case for connecting Java Objects in the visualization.
As a workaround, please write your patterns in a way that creates Items to be connected from EMF model elements instead of Java objects such as names.
Sorry for the inconvenience,
Zoltán
|
|
|
Goto Forum:
Current Time: Fri Apr 18 04:05:11 EDT 2025
Powered by FUDForum. Page generated in 0.03727 seconds
|