To collect all Leaf Requirements Owned Recursively


  1. Create an Opaque Behavior named 'All Leaf Requirements Owned Recursively'.
  2. Right-click the Opaque Behavior element/symbol and open its Specification window. Do one of the following:
    1. Click the plus sign next to the Owned Parameter property to edit it.

      If you cannot see the Owned Parameter property, make sure the Expert mode is enabled.

    2. On the left side menu, select Parameters > Create.
  3. In the Specification of Parameter window, set Name to input, Type to Class, and Direction to in. Click Back.
  4. In the Opaque Behavior Specification window, click three dots  next to the Body and Language property to edit it.
  5. In the Body and Language dialog, select Language > StructuredExpression.
  6. Click Create Operation > Filter.

    If you cannot see the Filter operation under Operations, make sure the Expert mode is enabled.

  7. Select Input > Implied Relation.
  8. Select Element and set the Value to input.
  9. Select Criteria > Body > Reset.
  10. Select Criteria > Body > Contextual Variable.
  11. Select Source > Body > Simple Navigation > Clear All.
  12. Select Source > Body > Simple Navigation. Select Owned Element and set Is Applied to true, Direction to Source To Target, and Result Type to Requirement (select Include Subtypes check box). 
  13. Select Target > Reset.
  14. Select Predicate > Nested Operation.
  15. Select Body > Operation from Model > isEmpty.

    If you cannot see the isEmpty operation, make sure the Apply Filter box is not checked.

  16. Select Input > Simple Navigation. Select Owned Element and set Is Applied to true, Direction to Source To Target, and Result Type to Requirement.
  17. Click OK.

Sample model

The model used in these examples is the Case Studies for Querying the Model sample model. To open this model, you need to download case studies for querying the model.mdzip