Looking at the documentation in AQL in the Help section, I am not able to use filter functionality and conditions functionality in the Sirius interpreter. Example of them follows:
filter:
I am trying to filter Constraint object from the below query:
I think You need to filter on capellacore::Constaint. You can direclty include the filter in the eContents() or eAllContents(). This way AQL will try to prune branches of the model:
self.target.eContents(capellacore::Constaint)
If you want to keep more than one type of element you can also use this kind of filter.
The if statement looks correct depending on what element you call it on. But you forgot the aql: prefix so Sirius can delegate the evaluation of the expression to AQL.
You should probably use the M2Doc Interpreter view initialized with your .genconf file. It will evaluate AQL expressions in the context of your template. You still have access to the current selection with the selection variable.
Explanation: I am trying to show the literal value in the title block, but I am able to get the id as the context is stored in the form of Constraint.
AQL query: (Applied on the Functional Chain Descriptor Diagram(FCD) diagram) aql:self.target.eContents()->select(ele|ele.summary='FCI').exchangeContext.ownedSpecification.bodies.substring(10,45)
Here: select(ele|ele.summary='FCI') is filtering the Functional Chain Involvement Links in the diagram as those elements are having the value to be populated in the Title block.
Result:
Following are my queries:
Q1: I want to access the String Literal Value referenced in the Exchange Context, is there any other way to achieve that?
Q2: Are nested AQL query possible. e.g. If can use this sequence of IDs obtained by the above query to filter those element who have any of the id present in it?
Q3: I could have used the ->filter(fa::FunctionalChainInvolvementLink) to filter them, but I observed that while it worked in Sirius interpreter, it didn’t work when place in the title block. Why so?
From here the remaining of the expression depend on what type of ValueSpecification is used. You can open the .capella file to find your FunctionalChainInvolvementLink by its ID for instance and have a look at the structure of its exchangeContext. The XML structure should give you the EReferences to navigate. I think you should have an implementation of AbstractEnumerationValue but I’m no sure which one.
It depend how the AQL interpreter has been initialized in the title block. Maybe some EPackages (metamodels) are not registered… But it looks like it’s using the Sirius interpreter. You can ask in the main forum how the title block interpreter is initialized.