Skip to main content



      Home
Home » Modeling » Epsilon » how to read xmi:id field in EuGENia model file?
how to read xmi:id field in EuGENia model file? [message #1834184] Wed, 04 November 2020 07:30 Go to next message
Eclipse UserFriend
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 08:29] by Moderator

Re: how to read xmi:id field in EuGENia model file? [message #1834185 is a reply to message #1834184] Wed, 04 November 2020 07:42 Go to previous messageGo to next message
Eclipse UserFriend
Hi Fatima,

As you seem to be using Acceleo to query your model I'd suggest posting this message to the Acceleo forum instead.

Thanks,
Dimitris
Re: how to read xmi:id field in EuGENia model file? [message #1834186 is a reply to message #1834185] Wed, 04 November 2020 07:50 Go to previous messageGo to next message
Eclipse UserFriend
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 08:29] by Moderator

Re: how to read xmi:id field in EuGENia model file? [message #1834188 is a reply to message #1834186] Wed, 04 November 2020 08:28 Go to previous messageGo to next message
Eclipse UserFriend
Hi Fatima,

I've added a small example that shows how you can query GMF diagrams (as opposed to their underlying models) with EOL in https://git.eclipse.org/c/epsilon/org.eclipse.epsilon.git/tree/examples/org.eclipse.epsilon.eugenia.examples.friends.models.

Thanks,
Dimitris
Re: how to read xmi:id field in EuGENia model file? [message #1834189 is a reply to message #1834188] Wed, 04 November 2020 09:12 Go to previous messageGo to next message
Eclipse UserFriend
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 05:12] by Moderator

Re: how to read xmi:id field in EuGENia model file? [message #1834198 is a reply to message #1834189] Wed, 04 November 2020 13:45 Go to previous message
Eclipse UserFriend
Hi Fatima,

I'm sorry, I don't know how Acceleo exposes the XMI id of model/diagram elements.

Thanks,
Dimitris
Previous Topic:Using EOL source code or developing haetae
Next Topic:ETL Standalone Demo
Goto Forum:
  


Current Time: Sun Jul 13 10:07:53 EDT 2025

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

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

Back to the top