Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » links between two nodes(sirius EMF XSD XML)
links between two nodes [message #1765681] Tue, 13 June 2017 09:47 Go to next message
Paul Aubry is currently offline Paul AubryFriend
Messages: 9
Registered: March 2017
Junior Member
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 09:52]

Report message to a moderator

Re: links between two nodes [message #1765692 is a reply to message #1765681] Tue, 13 June 2017 13:05 Go to previous messageGo to next message
Pierre-Charles David is currently offline Pierre-Charles DavidFriend
Messages: 703
Registered: July 2009
Senior Member
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


Pierre-Charles David - Obeo

Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: links between two nodes [message #1765700 is a reply to message #1765692] Tue, 13 June 2017 13:58 Go to previous message
Paul Aubry is currently offline Paul AubryFriend
Messages: 9
Registered: March 2017
Junior Member
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: Fri Apr 19 20:49:02 GMT 2024

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

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

Back to the top