This service is archived, please use www.eclipse.org/forums


Home » Capella » Capella workbench » Retrieve requirement using aql query for m2doc
Retrieve requirement using aql query for m2doc [message #1766] Tue, 19 December 2017 16:45 Go to next message
Arun is currently offline  Arun
Messages: 56
Registered: July 2017
Member
Hello all

I am trying to use the new interpreter view in Capella 1.2 to get the requirement details from a logical component. I have imported and allocated some requirements to the model element. I would like to retrieve this requirement during document generation using M2Doc. However I could not find right query to get the requirement details. Is this possible if the model is extended using an addon (requirement addon in this case).

Any help much appreciated.

Best Regards
Arun
Re: Retrieve requirement using aql query for m2doc [message #1771 is a reply to message #1766] Thu, 21 December 2017 05:07 Go to previous messageGo to next message
yacine.benannoune.gmail.c is currently offline  yacine.benannoune.gmail.c
Messages: 8
Registered: December 2017
Junior Member
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}
Re: Retrieve requirement using aql query for m2doc [message #1776 is a reply to message #1771] Fri, 22 December 2017 09:53 Go to previous messageGo to next message
Arun is currently offline  Arun
Messages: 56
Registered: July 2017
Member
Thanks Yacine
I am indeed using Requirement VP.
I figured it out. Using the below script you can get the text of a requirement from the a Capella Function element.
m: function.ownedExtensions->filter(CapellaRequirements::CapellaOutgoingRelation)- >first().target.ReqIFText

Regards
Arun
Re: Retrieve requirement using aql query for m2doc [message #1777 is a reply to message #1776] Fri, 22 December 2017 12:43 Go to previous messageGo to next message
yacine.benannoune.gmail.c is currently offline  yacine.benannoune.gmail.c
Messages: 8
Registered: December 2017
Junior Member
Hi,

That's nice you figured out

Thanks you, I am actually trying to get requirements from Requirements VP.

But when I use M2Doc I have an error : Eclassifier.

https://polarsys.org/forums/index.php/fa/503/0/
Do you have added some ressource dependency to M2Doc to be able to retrieve properties of Requirements VP?

Thanks !

Best regards

Yacine.

[Updated on: Fri, 22 December 2017 12:48]

Report message to a moderator

Re: Retrieve requirement using aql query for m2doc [message #1778 is a reply to message #1777] Sun, 24 December 2017 15:57 Go to previous messageGo to next message
Arun is currently offline  Arun
Messages: 56
Registered: July 2017
Member
Hello

Here is the screenshot of the dependencies that I added. Note sure which is the exact one.

index.php/fa/505/0/

Regards
Arun
Re: Retrieve requirement using aql query for m2doc [message #1781 is a reply to message #1778] Tue, 02 January 2018 07:43 Go to previous messageGo to next message
Aurélien Pinsonneau is currently offline  Aurélien Pinsonneau
Messages: 169
Registered: November 2016
Senior Member
Hello,

The two packages to add are the following ones:
- http://www.polarsys.org/capella/requirements
- http://www.polarsys.org/kitalpha/requirements
Re: Retrieve requirement using aql query for m2doc [message #1784 is a reply to message #1781] Mon, 08 January 2018 03:21 Go to previous messageGo to next message
yacine.benannoune.gmail.c is currently offline  yacine.benannoune.gmail.c
Messages: 8
Registered: December 2017
Junior Member
Thanks it's working !

I have another question, in case you want to retrieve all CapellaIncomingRelation what is the best way?

I have write this but it's not perfect because I iterate all CapellaIncomingRelation and check if id match.

{m:for fc | self.eAllContents(la::LogicalFunction)}

{m:for relation | self.containedLogicalArchitectures.eAllContents()->filter(CapellaRequirements::CapellaIncomingRelation)- >select(test | test.target.id.equalsIgnoreCase(fc.id))}
Req : {m:relation.source.ReqIFText}
{m:endfor}

{m:endfor}

[Updated on: Tue, 09 January 2018 04:43]

Report message to a moderator

Re: Retrieve requirement using aql query for m2doc [message #1787 is a reply to message #1784] Tue, 09 January 2018 06:26 Go to previous messageGo to next message
Arun is currently offline  Arun
Messages: 56
Registered: July 2017
Member
Hi

I used the below one for retrieving outgoing relations from a function

m:for req | function.ownedExtensions->filter(CapellaRequirements::CapellaOutgoingRelation)

Regards
Arun
Re: Retrieve requirement using aql query for m2doc [message #1788 is a reply to message #1784] Tue, 09 January 2018 06:55 Go to previous messageGo to next message
Aurélien Pinsonneau is currently offline  Aurélien Pinsonneau
Messages: 169
Registered: November 2016
Senior Member
Hello Yacine,

I have used a similar query in order to find the incoming requirements.
As long as your model is not too big and the time required to generate your documentation is acceptable, you should keep it like this.

If you reach unacceptable generation time, please tell us and will see how we can improve this.
Re: Retrieve requirement using aql query for m2doc [message #1789 is a reply to message #1788] Wed, 10 January 2018 03:42 Go to previous message
yacine.benannoune.gmail.c is currently offline  yacine.benannoune.gmail.c
Messages: 8
Registered: December 2017
Junior Member
Hello,

Ok I see, I will keep it like this for the moment.

Thanks.
Previous Topic: Importing custom attributes of requirements
Next Topic: Reading Capella Models
Goto Forum:
  


Current Time: Sat Apr 04 00:39:59 EST 2020

Total time taken to generate the page: 0.01903 seconds