links between two nodes [message #1765681] |
Tue, 13 June 2017 09:47 |
Paul Aubry 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 |
|
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
|
|
|
|
Powered by
FUDForum. Page generated in 0.03167 seconds