Problem in creating edge when classes in different packages in sirius [message #1794565] |
Mon, 03 September 2018 06:54 |
Prajna VG Messages: 54 Registered: July 2018 |
Member |
|
|
Hi all, I have a model with multiple packages. And am trying to create a diagrammatic representation for them using sirius. I have an eClass in one package. And a class from other package is used to connect classes in first package. Can I do that?If so how can I create an edge between nodes using a class from other package.
For example like there are two packages Building and Books under a package Products .
In package Building I have a class called Shop
And in package Book there is a class called Pages. And one more class called Address which extends Pages class. And there is a Factory class called ProductFactory. Now is it possible to connect two shop class nodes with address class as an edge?
[Updated on: Wed, 05 September 2018 08:49] Report message to a moderator
|
|
|
|
|
Re: Problem in creating edge [message #1794702 is a reply to message #1794602] |
Wed, 05 September 2018 06:49 |
Prajna VG Messages: 54 Registered: July 2018 |
Member |
|
|
Hi Pierre,
Thanks for replying..!!
There is no direct relation. I mean there is only pages reference(for page class). No adresses reference. Address is subclass of page. So it is getting difficult to create an edge. Then we can not do in that meta model?
May I know can we create the edge using the Java action? I tried using that also..
How can we pass the diagram as parameter to Java action.
If I use let diagram with value expression aql:diagram::DSemanticDiagram and pass that argument to Java action as parameter
DSemanticDiagram diagram = (DSemanticDiagram) parameters.get("diagram");
Iterator<DDiagramElement> it = new DDiagramQuery(diagram).getAllDiagramElements().iterator();
It gives class cast exception like this.
We have already that model with many packages and in multi level. It takes time to recreate model in one package. So we are trying to apply for that model only!!
[Updated on: Wed, 05 September 2018 07:08] Report message to a moderator
|
|
|
|
|
|
Re: Problem in creating edge [message #1794838 is a reply to message #1794722] |
Fri, 07 September 2018 12:35 |
Prajna VG Messages: 54 Registered: July 2018 |
Member |
|
|
Hi Pierre,
I can create an edge without using service and java method.
If I create an instance of book i am able to create an edge. But an instance of book also getting created i.e., one book node also getting created in diagram. Can we get edge without creating an instance of book?
Instead of create instance I tried using by this expression in change context
aql:source.eContainer().eContainer().eContents(products::books)
but when I use this, edge is not getting created.
[Updated on: Fri, 07 September 2018 12:36] Report message to a moderator
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.06241 seconds