Skip to main content



      Home
Home » Eclipse Projects » Sirius » links between two nodes(sirius EMF XSD XML)
links between two nodes [message #1765681] Tue, 13 June 2017 05:47 Go to next message
Eclipse UserFriend
Hello,

I got a model with serveral elements and references. I want to know how can I make the link between these?

Here is an example :
<?xml version="1.0" encoding="UTF-8"?>
<assembly xmlns... xsi:noNamespaceSchemaLocation="xxx.xsd">

	<instance componenttype= "Altitude50" implementation="C" name="Altitude50Inst"/>
	<instance componenttype= "Aircraft50" implementation="C" name="Aircraft50Inst"/>

	<links>
		<eventlink  fifosize="1">
			<sender instance="Altitude50Inst" operation="Aircraft_ChangeBaroSettingCommand"/>
			<receiver instance="Aircraft50Inst" operation="Aircraft_onChangeBaroSetting"/>
		</eventlink>

		<datalink direct="true">
			<writer instance="Aircraft50Inst" operation="Aircraft_LocalAircraftGnssAltitudeMemOut"/>
			<reader instance="Aircraft50Inst" operation="Aircraft_LocalAircraftGnssAltitudeMemIn"/>
		</datalink>
	</links>
</assembly>


So, as you can see, there are relations between the "instances" and the "links" by the name of the instance.

I want to present the graphic with the Instance as a node and the links (or the datalink) as a borderedNode. How should I do to do that?

Thanks a lot!

[Updated on: Tue, 13 June 2017 05:52] by Moderator

Re: links between two nodes [message #1765692 is a reply to message #1765681] Tue, 13 June 2017 09:05 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

* Define a node mapping to represent your instance element;
* Inside that mapping, define a border node mapping on your link type(s), with a Semantic Candidate Expression that, from the instance, locates all the links which point to it (by name). The details of the expression will depend on how your XML/XSD is mapping in terms of EMF models, but it will probably looks something like
aql:self.eContainer().link.eAllContents()->select(l | l.instance = self.name)


In other words: navigate up to the parent assembly, then down in links, and select all contained elements whose instance attribute matches the current instance's name.

See the documentation for how to write your actual expression (the above is untested, it's just to give an idea).

Regards,
Pierre-Charles David
Re: links between two nodes [message #1765700 is a reply to message #1765692] Tue, 13 June 2017 09:58 Go to previous message
Eclipse UserFriend
thnaks a lot! I will test that !
Previous Topic:How to difference elements in some diagrams under the same model
Next Topic:EventAdapter to models
Goto Forum:
  


Current Time: Mon Jul 14 23:23:22 EDT 2025

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

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

Back to the top