DSD-DBS/py-capellambse

allocating_physical_path should return list of elements

Closed this issue · 2 comments

A Logical Component Exchange can be allocated to more than one Physical Path on PA. Currently capellambse only returns a single Physical Path element and hence doesn't allow full representation of possible Capella Models.

Also, allocating_physical_path could be renamed to allocating_physical_paths

I've tried to test this for the versions 5.0.0 and 6.0.0 but can't accomplish a state where I can link multiple PhysicalLinks to the same ComponentExchange (especially from the Logical Layer). The tree simply doesn't allow it. I mean the needed change would be very small:

c.set_accessor(
    fa.ComponentExchange,
    "allocating_physical_links",
    c.ReferenceSearchingAccessor(PhysicalLink, "exchanges", aslist=c.ElementList),
)
c.set_accessor(
    fa.ComponentExchange,
    "allocating_physical_link",
    c.DeprecatedAccessor[PhysicalLink]("exchanges"),
)

But first I'd like to see that can be properly done in Capella via the UI. Can you give me instructions on how to model this in a minimal way?

Sure, I have a typical PC with Ethernet and WIFI connection as example. Note it is about Physical Paths, not Physical Links.

image

It shows that you can have the logical component exchange routed over two different physical paths, via Ethernet, or via WIFI.

In the Semantic Browser, it shows:

image

capellambse only supports one of the physical paths and crashes with this model if you try to access

model.pa.all_component_exchanges[0].allocating_physical_path