Why do I get a warning with my query ending with ".eContainer().name"?

Hello,
I have an issue because I get warnings.
With the following query, it perfectly works.

sys.implementedInterfaces.implementorComponents->select( stak | stak.actor=true)->at(3).eContainer()

I get the following output :

org.polarsys.capella.core.data.pa.impl.PhysicalComponentImpl@a62989a (id: 51903a3b-0e5b-40f9-9a9b-8dbffc51b585, sid: null) (visibleInDoc: true, visibleInLM: true, summary: null, review: null) (name: Customers, abstract: false, actor: true, human: false, kind: UNSET, nature: NODE)

However, when I want to get the name of the component, It works but with a warning.

PS : In the Sirius Interpreter, I don’t have this warning.
If you have any suggestion, don’t hesitate. Thanks in advance !

Hi,
you have to use the method getName(), instead of the attribute name, otherwise you need to cast the eContainer to the proper Capella element type by using oclAsType()

sys.implementedInterfaces.implementorComponents->select( stak | stak.actor=true)->at(3).eContainer().oclAsType(pa::PhysicalComponent).name
2 Likes

I tried and it perfectly works with both solutions !
Thanks for your answer