Problem with extracting interfaces from CII diagram


I’m using M2DOC to generate documentation from my capella model and I’ve encountered an error when trying to extract interfaces from a CII “Contextual Internal Interface” diagram.

I’m using the following M2DOC command:

{m:let contenuDiagram = '[CII] Bilan des interfaces KPVA '. representationByName().eAllContents(viewpoint::DRepresentationElement).semanticElements}
{m:for interface|contenuDiagram->filter(cs::Interface)}


At the generation, I get the following error:
“Couldn’t find the ‘aqlFeatureAccess(org.eclipse.acceleo.query.runtime.impl.Nothing,java.lang.String)’ service” under the “let” command (as mentioned above)

I should note that the command “self.eAllContents(viewpoint::DRepresentationElement).semanticElements->filter(cs::Interface)” works correctly when plugged in the capella interpreter (self = clicking on the back of the CII diagram) and I get the interfaces in the CII diagram as an interpreter result.

Is this problem caused by missing nsURI packages (I already added the *capella and *sirius packages in my template properties) or is it a semantic problem?

I’m using capella 1.4.0 with M2DOC version 3.0.0
The same command works correctly for a LAB diagram with M2DOC ( for example with filter (la::LogicalComponent)).

I think '[CII] Bilan des interfaces KPVA '. representationByName().eAllContents(viewpoint::DRepresentationElement) doesn’t return anything which cause the error when accessing .semanticElements.
First check the trailing space in the representation name. Maybe it’s from the copy/past here or in your template. If it’s not the trailing space you should try the expression with out the .semanticElements and outside of a let to see if you can get more information in the error message.
And yes a missing nsURI whould have been a good candidate.

Hello Yvan,

Thank you for your reply.
As you mentioned, I deleted the extra blank spaces at the end of the diagram name, between the (’ ') signs, and before the representationByName command.
The problem was solved and I was able to display the interfaces in my generated document.