M2Doc query for requirement allocation of system functions

Hello,

I am trying to elaborate traceability matrices between requirements and system functions (or generic capella elements) using M2Doc, and having troubles trying to access the requirement allocation field within a generic capella object (e.g. a system function).

So far, I was able to build the traceability matrix from requirements to a generic capella object (e.g. system function) using the following query in the M2Doc word template

self.eAllContents()->filter(Requirements::Requirement).eContents()->filter(Requirements::AbstractRelation)->select(r | r.oclIsKindOf(CapellaRequirements::CapellaIncomingRelation)).target.getName()

which provides the list of full Incoming relations I defined for each requirement (Not sure if this also is the best query I can make).

I would need a query that for each capella object (e.g. system function) returns the list of allocated requirements. Specifically the list of reqs in the screen below for a generic system function

Generally, is it good practice to build such traceability matrices directly in the word template?

Thanks in advance for your help!

Hi,
I faced the same issue, since the queries implemented in the Semantic Browser view extensions provided by VP Requirement addon are not available in M2doc.

Have a look at https://forum.mbse-capella.org/t/requirement-vp-semantic-browser-queries-for-m2doc/10525/2?u=pge62