how to read xmi:id field in EuGENia model file? [message #1834184] |
Wed, 04 November 2020 12:30 |
Fatima Rani Messages: 22 Registered: April 2020 |
Junior Member |
|
|
Hi ! my all meta-models are registered,i want to read the xmi:id field of the model file but unable to retrieve its value,any suggestion?
model file :
<?xml version="1.0" encoding="UTF-8"?>
<notation:Diagram xmi:version="2.0" xmlns:xmi="[url]http://www.omg.org/XMI[/url]" xmlns:xsi="[url]http://www.w3.org/2001/XMLSchema-instance[/url]" xmlns:abcd="[url]https://petrinetdsl[/url]" xmlns:ecore="[url]http://www.eclipse.org/emf/2002/Ecore[/url]" xmlns:notation="[url]http://www.eclipse.org/gmf/runtime/1.0.3/notation[/url]" xmi:id="_vSD84LHJEeq1h8ti2UwKzQ" type="Petrinetdsl" name="default.petrinetdsl_diagram" measurementUnit="Pixel">
<children xmi:type="notation:Node" xmi:id="_qLutgLHPEeqGGrut8ExKFg" type="2001">
<children xmi:type="notation:DecorationNode" xmi:id="_qLxJwLHPEeqGGrut8ExKFg" type="5001">
<layoutConstraint xmi:type="notation:Location" xmi:id="_qLxJwbHPEeqGGrut8ExKFg" x="-78" y="7"/>
</children>
<styles xmi:type="notation:DescriptionStyle" xmi:id="_qLvUkLHPEeqGGrut8ExKFg"/>
<element xmi:type="abcd:Place" href="default.petrinetdsl#//@places.0"/>
<layoutConstraint xmi:type="notation:Bounds" xmi:id="_qLvUkbHPEeqGGrut8ExKFg" x="259" y="175"/>
</children>
my code for reading different key and values
[for (aNode: Node | aDiagram.children)]
[aNode/]
[/for]
[aDiagram.children.element/]
[aDiagram.children.styles/]
[aDiagram.children.layoutConstraint/]
Thanks!
[Updated on: Wed, 04 November 2020 13:29] by Moderator Report message to a moderator
|
|
|
|
Re: how to read xmi:id field in EuGENia model file? [message #1834186 is a reply to message #1834185] |
Wed, 04 November 2020 12:50 |
Fatima Rani Messages: 22 Registered: April 2020 |
Junior Member |
|
|
Hi! Thanks for your reply! I did it there as well! suppose if i am not using acceleo, is there any way to get the value which are like xmi: id , xmi:type , href= ""?
model file is this :
<children xmi:type="notation:Node" xmi:id="_qLutgLHPEeqGGrut8ExKFg" type="2001">
<children xmi:type="notation:DecorationNode" xmi:id="_qLxJwLHPEeqGGrut8ExKFg" type="5001">
<layoutConstraint xmi:type="notation:Location" xmi:id="_qLxJwbHPEeqGGrut8ExKFg" x="-78" y="7"/>
</children>
<styles xmi:type="notation:DescriptionStyle" xmi:id="_qLvUkLHPEeqGGrut8ExKFg"/>
<element xmi:type="abcd:Place" href="default.petrinetdsl#//@places.0"/>
Thanks in advance!
[Updated on: Wed, 04 November 2020 13:29] by Moderator Report message to a moderator
|
|
|
|
Re: how to read xmi:id field in EuGENia model file? [message #1834189 is a reply to message #1834188] |
Wed, 04 November 2020 14:12 |
Fatima Rani Messages: 22 Registered: April 2020 |
Junior Member |
|
|
Hi Dimitris! Thanks again for a quick reply! i have seen the above example;it is like
friends model example:
for (shape in Shape.all) {
shape.id.println();
shape.layoutConstraint.println();
shape.element.type.println();
}
which i have done by :
[aDiagram.children.element/]
[aDiagram.children.styles/]
[aDiagram.children.layoutConstraint/]
and:
[for (aNode: Node | aDiagram.children) ]
x="[aNode.layoutConstraint.eGet('x')/]"
y="[aNode.layoutConstraint.eGet('y')/]"
width="[aNode.layoutConstraint.eGet('width')/]"
height="[aNode.layoutConstraint.eGet('height')/]">[/for]
the problem is that i can get the value of any node and edges (which are in form of type, x,y, width,height,source and target etc ) but not like xmi:id etc.
Type value of node are not unique there are repeating in model so i need to use the value of xmi:id which is unique for every node and edge. :(
[Updated on: Thu, 05 November 2020 10:12] by Moderator Report message to a moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.03901 seconds