how to edit "Requirements Viewpoint" requirements with M2DOC

I try to edit via M2DOC requirements generated with View Point Requirement Addon.
I don’t succeed in finding the accurate sequence. I try to access to the requirements via
self.eAllContents (CapellaRequirements::CapellaModule).eContents().
It is recognized by Sirius Interpreter but not by The Model Template.doc.
could you help me?
Thanks

Hi David,
Looking at this thread should help:
https://forum.mbse-capella.org/t/487/
Stephane

Hi Stephane,
Many Thanks for your advice, it’s working now!
Merci beaucoup
david

Excellent!

The link above is not working. Coudl you please correct as I have the same question but unable to find a solution

Hi Florian,

I think it is not available anymore because this thread was hosted on the old Capella forums, and for some time now these forums are no more accessible (maybe they were moved elsewhere ?).

However, I recently worked on M2Doc templates with requirements. I managed to get them by using the following query : self.eAllContents()->filter(Requirements::Requirement)

So for instance you can get the requirement names by typing: self.eAllContents()->filter(Requirements::Requirement).ReqIFName

Other solutions may exist but this worked great for my case.

Hope this helps.

Hello, thanks for fast reply, but for me it doesn´t work, beside the sirius interpreter works fine, in the template it doesn’t.

Invalid for statement: Expression “self.eAllContents() ->filter(Requirements::Requirement)” is invalid: invalid type literal requirements::Requirement

May be It is a problem in the nsURI (expert) Settings?

I am using Capella 1.4.1, Requirement VP and M2Doc 3.1

ReqLinked.jpg
ReqTemplateError.png

The message in the old forum was saying:
Hi,

Are you using the Requirement VP extension?

When not using the extension, something like that should work

{m:for lc | self.eAllContents(la::LogicalComponent)}

Logical Component : {m:lc.name}

Requirements :

{m:for req | lc.appliedRequirements}

Req Name : {m:req.name}
Req Id : {m:req.requirementId}

{m:endfor}

{m:endfor}

Ok, I had problems in the ‘Sirius Session’ because of used ‘space’ in the .ard name… There should be an advise not to use blank/space in the project naming!
After hours of renaming and ‘reapair’/refresh it is working now…

How can I transfer the information visible in the semantic browser (Requirements Relations as described here : https://www.eclipse.org/forums/index.php/m/1822791/?srch=Relation#msg_1822791 ) to M2Doc?
It is so annoying to search for the right query without an easy Information of how M2doc works or how to query for the right data…

M2Doc on itself is not domain dependent, for instance it can be applied on other model than Capella models.
To help you write queries you can use the Sirius interpreter view or the Word add in if you are using M2Doc 3.1.0.
But the specific features you can access or type of element you can manipulate are mostly domain specific and not related to M2Doc.
In your particular case you will need to write a Java service that use the code used in the semantic browser. Maybe such utility methods already exists, but you should ask Capella developers.
One starting point might be the org.polarsys.capella.common.ui.toolkit.browser.contentProviderCategory extension point and the IQuery interface.

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