Example: Recursive levels and recursive segments with a Rational RequisitePro data source schema

You can see a list of software requirements by using the PRRequirement query in the IBM® Rational® RequisitePro® schema available to you in the samples installed with Rational Publishing Engine: RPE_HOME\source\XML\examples\RequisitePro.xsd

For each PRRequirement, you can extract all of the child requirements, and for each child requirement, extract its child requirements without adding each query to your template.

Instead of adding each of these following queries:
You can construct one query for these requirements automatically:
  1. Add the Project/Requirements/PRRequirement/Children/Relationship/RelatedReq query to an element.
  2. Add values to the Recursive Level and Recursive Segments properties:
    • For the Recursive Level property, enter 4.

      Recursive Level represents how many levels deep the query is. If you enter a value of one or higher, you must also set a value of one or higher for the Recursive Segments property.

    • For the Recursive Segments property, enter 3.
      Recursive Segments represents how many times the segments repeat in the query. The segments in this example are Children/Relationship/RelatedReq.
      Note: The number entered for the Recursive Segments property cannot be higher than the number of segments that the query contains. The parent query is not included as a segment.
  3. Run the report to test.
    On running the report, these queries are included:
    • [$1] – Project/Requirements/PRRequirement/Children/Relationship/RelatedReq
      Note: The first query must include the full context for the query.
    • [$2] – $1/Children/Relationship/RelatedReq
    • [$3] - $2/Children/Relationship/RelatedReq
    • [$4] – $3/Children/Relationship/RelatedReq
    If you find that the number entered for the Recursive Segments property is higher than the number of segments that the query contains, you can use one of these two options to resolve the issue:
    • Select the element that has the Recursive Segments property applied. In the Properties view, select the Data tab and decrease the value for the recursive segments property.
    • You can also redesign the query to start from a different parent query. If your Recursive Segments value is one segment too high, create a container element and add a query that is one level higher than the parent query of the existing element. Then move the existing element into the container element.

Feedback