[Python4Capella] Retrieve the logical component and the realized capability from a CapabilityRealization


At Logical Architecture Layer, I would like to retrieve the Involved Components (logical component) and the Realized Capabilities (at System Analysis Layer) of a Capability Realization.

But it seems that the methods below doesn’t work :

  • get_realized_capability_realizations
  • get_involved_logical_components

Also, when I use the methods get_all_contents or get_java_object on CapabilityRealisation, I don’t see the Involved Components and the Realized Capabilities related to this element.

Do you have any idea on how to retrieve these information, please ?


Hi Edgar,

I just tried the get_involved_logical_components() and you are right, it seems like it is not working. From what I understood in the simplified metamodel provided with Python for Capella, it seems it is marked as implemented but not working. So maybe it will be fixed later.
For that kind of case, I usually use the capella_query_by_name method. In your case, to get the involved Logical Components from a Realized Capability, the synatx would be:

capella_query_by_name([Realized Capability object], "Involved Components")

It will return the objects you see in the semantic browser under the “Involved Components” section. Note that the involved Logical Actors would be included in those Components.

Now, about getting the Realized Capabilities at System level, from your Logical level Capability Realizations, there are several points:

  • I think the right method to do that is get_realized_capabilities(). I tried it and it should work.
  • It seems to me that the same Realized Capability class is used to store Realized Capabilities at Logical AND Physical level, while the class for capabilities at System level is just Capability. As a result, there can be realization links between Capability Realizations, if one is at the logical and the other at physical level, for instance. I think that’s what the get_realized_capability_realizations() is for, and it seems to me that, in that regard, it works.
  • I tried the get_all_contents() and get_java_object() on a Capability Realization and it seems you’re right, and that the Involved Components and Realized Capabilities and no in there. But I must admit I don’t know why.

Maybe someone who knows more about it will be able to complete or correct me, but I hope this helps you. Let us know if it does not really answer your question.

Martin Le Bourgeois
ObeoSoft Canada

1 Like

Hi Martin,

Thank you for your help !

I didn’t know the capella_query_by_name method but it seems really useful when no method exists for what we want to do.

Effectively, I was not using the right method to retrieve the SA Capability allocated. Yes you are right about the difference between Capabilities and Realized Capabilities objects.

Thank you very much!


Hi Edgar,

You’re welcome, I’m glad I could help you.

I agree, the capella_query_by_name function is really convenient.
About its syntax, its first argument must be the object you want to start from, and, for the second one (the String argument), you just need to look in the semantic browser for the title of the sections and put the right one as a String.

Martin Le Bourgeois
ObeoSoft Canada