M2Doc and PVMT extension

Hi, I am trying to get M2Doc to generate documentation of custom PVMT add-on model properties.
I applied the following properties to ComponentExchanges as seen below:
I want to be able to display the contents of the string “description” on the generated doc.
I was able to access its value through the follwing aql query in Sirius interpreter:
aql:self.eAllContents(fa::ComponentExchange).eContents().eContents()->select(x | x.name = ‘Description’).value
but, whenever I try to access the feature “value” in the template like this:
it returns the following errors:

2020-03-18 17_43_17-workspace - Configuration PV - Capella.png
2020-03-18 17_49_41-InterfaceGen.generated.docx - Modo de Compatibilidade - Word.png
2020-03-18 17_50_58-InterfaceGen.docx - Modo de Compatibilidade - Word.png
2020-03-18 17_43_17-workspace - Configuration PV - Capella.png
2020-03-18 17_49_41-InterfaceGen.generated.docx - Modo de Compatibilidade - Word.png
2020-03-18 17_50_58-InterfaceGen.docx - Modo de Compatibilidade - Word.png

Just adding to this, I wanted to be able to reach the values of enumeration too but I’ve come to this point where it seems I can’t go on without getting the value from the applied properties.

You are collecting all elements at de depth of 2 and some of them don’t have a feature name (see error message for the list). You probably need to do something more specific.
You will need to select the extension of the corresponding type for PVMT:
myComEx.ownedExtensions->filter(PVMTPackage::PVMTType).description
you can use the .eClass() service in the interpreter to find the appropriate type. Select the extension and use “aql:self.eClass()”. If you want to know the list of features you can use “aql:self.eClass().eAllStructuralFeatures”.
You should also add PVMT metamodels to your template properties.

Hi Yvan,
I found a different solution (actually I believe it falls in your solution but is more specific). It was described in a topic on the old Forum (link below).
Too bad I wasn’t able to find it there before. I searched it but I only found it today by reading each post until finding the answer. I’ll leave the link so others can use this solution as well.
https://forum.mbse-capella.org/t/905/

Hi,

Since the link provided by Fabio_Guarita_old is not available anymore, I can suggest this solution.

The query

aql:self.eAllContents(fa::ComponentExchange).eContents().eContents()->select(x | x.name = ‘Description’)

return objects of type AbstractPropertyValue that doesn’t have feature named “value”.

Since “Description” feature is a StringProperty, you have to convert the result in StringPropertyValue before :

aql:self.eAllContents(fa::ComponentExchange).appliedPropertyValueGroups.eContents(capellacore::StringPropertyValue)->select(x | x.name = ‘Description’).value

Kind Regards

Valery

Copyright © Eclipse Capella, the Eclipse Capella logo, Eclipse and the Eclipse logo are Trademarks of The Eclipse Foundation.