Inserting a Context and a Context Call

You can define a context which corresponds to a block of template elements, and then you can call and perform the actions corresponding to this block at an in-depth level to recursively produce the same behavior at another level. In this scenario, you create a context providing chapter titles of a requirement specification, then you call this context to reproduce the behavior on another in-depth level to get the nested chapter titles.

This task shows you how to:


Before you begin: Create a requirement specification in the Traceable Requirement Management app. Insert in this requirement specification nested chapters.

Insert a Context

You can define a context to get the chapter titles of a requirement specification.

  1. Create a parameter of requirement specification type and name it ReqSpec.

    For more information, see Adding Parameters to a Template.

  2. Drag the To Specification Structure method from the Outgoing Relationships folder of the ReqSpec variable into the Graphical area.

    A loop on to specification structure appears and the associated iteration rel variable appears in the Data tab.

  3. From the Structures list, drag the Context element into the loop.
    A context area is added to the template structure. The default context name is c.
  4. To define the context, in the Properties tab:
    1. Optional: Replace the default name of the context.

      Important: Each context name must be unique.

    2. In the Parameter area, click New.
      A blank parameter with a default name p appears in the Parameters list and in the Data tab.
    3. Optional: Replace the default name.

      Important: Each parameter name must be unique.
      Note: You can change this name afterwards even if the parameter is used. For more information, see Renaming Template Elements.

    4. In the Type box, select the type corresponding to the type to be exploited in the context element. In this scenario, select Specification Structure relationship.
    5. To create the association with the upper loop of this scenario, enter the iteration variable corresponding to the previous selected type in the Parameters area. In this scenario, enter rel for the parameter p.
  5. To define the content of your context based on the parameters of this context, drag the To Chapter method from the Outgoing Types folder of the p variable into the context.

    A loop on to chapter appears in the template. The associated iteration cha variable appears in the Data tab.

  6. From the Structures list, drag the Paragraph element into the loop.
  7. Drag the Title method from the Attributes folder of the cha variable into the paragraph.

The following context is created in the Graphical area:

Insert a Context Call

You can call the previously defined context if you are in the same situation. This means that you must be in the same kind of loop as in the context and you can perform the instruction defined by the context at another in-depth level.

  1. To be in the same situation than in the context and to explore the subchapters of the requirement specification, drag the To Specification Structure method from the Outgoing Relationships folder of the cha variable into the loop returning chapters.

    Another loop on to specification structure appears in the template. The associated iteration rel2 variable appears in the Data tab.

  2. From the Structures list, drag the Context Call element into the loop.

    A <CALL> tag is added to the loop.

  3. Select the <CALL> tag, and then in the Properties tab:
    1. In the Name box, select the context. In this scenario, select c.
    2. To create the association with the upper loop of this scenario, enter the iteration variable corresponding to the previous selected type in the Parameters area. In this scenario, enter rel2 for the parameter p.

The following context call is created in the Graphical area: