Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Polarsys » M2Doc » Unable to find source name("Feature name not found in EClass CapellaElement")
Unable to find source name [message #1832333] Wed, 16 September 2020 13:57 Go to next message
Pierre B is currently offline Pierre BFriend
Messages: 18
Registered: July 2020
Junior Member
Hi everyone,

I'm working on a M2Doc template that will be used to generate automatically a requirement traceability file.

At a certain point in the document, I would like to have a requirement traceability table that links the requirements with the Capella elements that are allocated to them. Here is what I tried to do to achieve this:
index.php/fa/38916/0/

But then something weird happens. Everything works great except for the "Name" section where I got an error in the generated file, which says : "Feature name not found in EClass CapellaElement":
index.php/fa/38918/0/

However, when I use the Sirius interpreter in Capella, it seems that it should normally work:
index.php/fa/38917/0/

Does any of you have an explanation about this behaviour ?

On top of that, if someone has an idea about how to retrieve the type of element (e.g. "functional exchange" or "logical function"), I would also be glad to hear it.

Thanks !

Pierre

Re: Unable to find source name [message #1832365 is a reply to message #1832333] Thu, 17 September 2020 08:01 Go to previous messageGo to next message
Yvan Lussaud is currently offline Yvan LussaudFriend
Messages: 63
Registered: July 2009
Member
The EClass CapellaElementdoesn't has a feature name. You will need to cast the source element to capellacore::NamedElement:

relation.source.oclAsType(capellacore::NamedElement).name

Of course this will only works if the source is a NamedElement.

To retrieve the type of an element you can use element.eClass().
Re: Unable to find source name [message #1832368 is a reply to message #1832365] Thu, 17 September 2020 08:23 Go to previous message
Pierre B is currently offline Pierre BFriend
Messages: 18
Registered: July 2020
Junior Member
Thank you very much Yvan, it works just as expected.

I first thought that I could get the name by using relation.source.name because relation.source alone returned a long message containing an "id" field but also a "name" field. I'm kind of new to those advanced features of Capella so I'm not yet so familiar with its data structure and metamodel.

[Updated on: Thu, 17 September 2020 08:23]

Report message to a moderator

Previous Topic:How to edit templates directly ?
Next Topic:Problem with extracting interfaces from CII diagram
Goto Forum:
  


Current Time: Tue Apr 23 17:55:07 GMT 2024

Powered by FUDForum. Page generated in 0.02812 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top