Physical links between the physical composants

Hi everyone, i want to generate the physical links between the physical composants. Also, i wanted to generate the logical composants allocated to the physical function. I ddidn’t find any query to generate such informations. Is there anyone knows a query to generate these links. Thanks for helping.

You can use the PhysicalPort of a PhysicalComponent to get its PhysicalLink:

myPhysicalComponent.containedPhysicalPorts.involvedLinks

For the second query I don’t know what you mean, PhysicalFunctions are allocated to PhysicalComponent:

myPhysicalFunction.allocatingPhysicalComponents

This will work only for leaf functions. You can get the list of all allocating components like this:

myPhysicalFunction->closure(f | f.ownedFunctions).allocatingPhysicalComponents

This will collect recursively all owned functions and get their allocating components.

I have tried the first query, here my code :
Physical links
Here is the result that I have got :


I have even tried to put this query in the interpreter and it was correct.

myPhysicalComponent was an example of variable name which reference a PhysicalComponent.

Your variable sys is a PhysicalComponent so you can get the list of its PhysicalLink like this:

sys.containedPhysicalPorts.involvedLinks.name
1 Like

Thank you so much, it works

Hello @YvanLussaud, I have tried the second query to generate a Deploy behavior PC that is allocated to a NODE PC. This example explains what I wanted to generate
Capture d’écran 2022-09-29 100359
Capteur Heyliot 2 : Node Pc

  • Capteur 2 : A deploy behavior PC
    -Allocated function
    For the the second level (Capteur 2 and his allocated function) I have succeeded to generate it, but the first level I don’t have a clue how to do it.

If you look at the project explorer (the tree on the left in Capella), you can see that the Physical component “Meusure hauteur…” is contained in the PhysicalComponent “CAPTEUR HEYLIOT 2”.

So to know which EReference contains “Meusure hauteur…”, you can select it in the project explorer and use the Sirius interpreter view to get the name of the containing EReference:

aql:self.eContainingFeature().name

So in the interpreter you can use:

aql:self.ownedPhysicalComponents.allocatedFunctions

And in M2Doc

sys.ownedPhysicalComponents.allocatedFunctions

I have tried this query but it didn’t work.

Do you have an error message ?

I dont have an error message but i got nothing in the generated document.

You probably need to make sure you are navigating to the wright object for instance a PhysicalComponent with allocated functions. You can also use the Sirius interpreter and/or the M2Doc interpreter to test your expressions and see what is the cause of the problem.

1 Like

Okay thank you so much for your help.

1 Like