Custom Requirement diagram


Trying to get the correct aql expression to show in my diagram.
How do I get the right aql-expression to get the Level (enum from RequirementLevel) in the heading?’’
Skärmavbild 2022-07-04 kl. 13.40.33

From my experience, I would select the targeted item, then use “self.eContainer()” in the interpreter, add as many eContainer()'s as necessary, until you find an item you reconize.
Then, starting from the top item in your M2DOC template (self, top or root), try to obtain one of the items you got using eContainer(). When you find it you will be able to go all the way done to the item you had targeted at the beginning.
Strangely enough sometimes, you can’t go directly from the root item to the items all the way down. You have to split your expression into 2 parts.

I’ll try this and come back with the results :slight_smile:

1 Like


Assuming you have a Requirement (Requirement-1) of Type “Requirement Type” with an Enumeration attribute Level:

Then in the context of the Requirement element you will get the value of the “Level” attribute using:

aql:self.ownedAttributes->select(a | a.definition.ReqIFLongName = 'Level')->first()

The Enumeration Value Attribute then has a values field

Hope this helps.


In the interpreter I do get the correct value but when I apply it to the requirement VP I get rubbish


Indeed you are printing the EnumerationValueAttribute element. You should get the textual value for this attribute.
So with a .value appended at the end of the query you should have the actual name of the enumeration value.

aql:self.ownedAttributes->select(a | a.definition.ReqIFLongName = 'Level')->first().value



I tried your all expression but it doesn’t give any results other than null
Tried this
But even if it gives the result in the interpreter it doesn’t result anything other than the same rubbish


Hi John,
Here is what works for me:
aql:self.ownedAttributes->select(a | a.definition.ReqIFLongName = ‘Level’)->first().values.ReqIFLongName


I missed the ReqIFLongName in the end. So thanks!!!

Quick question, being able to evaluate capella requirements values with an aql querry, is that part of the native requirement add-on? Or was this part of an additional extension? Just curious.

Not sure what you are asking here - this thread deals with the standard Req add-on, more specifically writing AQL queries to change what is displayed in diagrams for requirements elements.

Being a noob on aql I realized that I was able to get any meta data out of the model with aql.

So this allowed me, with help, to modify the way requirement is displayed in my model by assigning the correct aql request. With this I managed to remove the need of an expensive req tool (even though that adds more benefits, which I don’t need for this small project)

I already set my self out to add title blocks with aql requests and looking into ways of connecting verification activities and by that get the full traceability I need

Thanks Stephane.
I am a bit confused, the only way I know of using aql requests is either on Capella Studio (extensions)/capella dev, or M2DOC (generating document). Is it possible to apply aql requests for Req Titles elsewhere? Like here :


Sorry for this noob question, I am so interested.

There are 2 things you can configure with AQL in the Requirements Viewpoint add-on:

  • the way labels are displayed in the Project explorer tree view: in Window > Preferences > Capella > Requirements
  • the way labels and content are displayed within diagrams: right click on the root “System Engineering” of a Capella project which has been referenced by the Requirements Viewpoint and select “Requirements Viewpoint → Configure Requirement’s label in diagrams”

I hope this helps.
Obeo Canada

1 Like

Yes it helps a lot! Thank you a lot. I will share this info with colleagues who were not aware about it.

Best regards,

I needed to add more options to each requirement to ensure an easy usability inside of Capella and still comply with our rules for tracability (normally done with DOORS or JAMA).
Also things like status on the requirement and so on,

To ensure that I have some of that information on the diagram element I needed to change the data (as per the documentation for requirement VP in hel content)

There is more info ot be extracted but for the Product requirement level it’s not needed. Moving down to system level this will be interesting (such as what requirement is it linked from and what verification id is verifying this and so on)

But this doesn’t stop here with Title blocks that one can configure as needed through aql.
I loved Capella before aql and with my, still rudimentary, knowledge of aql I adore it. And also giving me a possibility to save huge amount of money on a now redundant tool :slight_smile:

1 Like