OperationalActivity.get_incoming() returns FunctionalExchange instead of Interaction #251
Replies: 2 comments
-
|
Thank you for reporting this bug. In the Capella metamodel there is only one class Let me know if the path solve this issue. |
Beta Was this translation helpful? Give feedback.
-
|
Let's continue on the issue #252. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
While working with the Python Capella API wrappers, I noticed that the method
OperationalActivity.get_incoming()does not behave as documented/expected.Expected behavior:
According to the wrapper definition:
Calling
get_incoming()on anOperationalActivityinstance should return a list ofInteractionobjects (operational-level exchanges).Actual behavior
Even when the variable is of type
OperationalActivity, the result is a list ofFunctionalExchangeobjects (functional-level exchanges), coming from the base classFunction:So it looks like the override in
OperationalActivityis either not applied correctly at runtime, or the wrong wrapper is being used internally.Steps to reproduce
Impact
This makes it inconsistent to work with Operational Analysis models:
But in practice both levels currently expose
FunctionalExchange, which breaks the abstraction of the OA layer.Temporary Workaround
The idea is that both Interaction (OA) and FunctionalExchange (FA) wrap the same underlying Java class (fa.FunctionalExchange). By re-wrapping with the desired Python class you restore the expected OA semantics without altering the model.
Suggested fix
OperationalActivity.get_incoming()(and similarlyget_outgoing()) consistently returnInteractionobjects as defined in the wrapper.Beta Was this translation helpful? Give feedback.
All reactions