Model Templates : Template for Interleaf : Segment 2: Activity-Chart Plot and Property Report (Interleaf)

Segment 2: Activity-Chart Plot and Property Report (Interleaf)

The second segment of the template, seg2, produces the activity’s plot and generates a property report for all of its subactivities using plot and report functions. Formatting commands are introduced where appropriate. One variable (ac_list) is declared, which represents the list of subactivities from which the property is constructed.

The segment’s body begins with the DGL verbatim symbol, /@. This command indicates that everything between it and the following @/ symbol is to be included verbatim in the output document segment. The comments do not actually appear in the generated output, but explain the function of each command when interpreted by Interleaf. The generated output is as follows:

<my_new_page> -- starts a new page. The definition
of this command is included
in ”my_glob”.
<sect> -- starts a section. (see Segment 1).
<Autonum, List8, 2><TAB>System Activities -- writes
-- section header.
<subsect> -- starts a subsection.
<Autonum, List8, 2><TAB> Activity-chart -- writes
-- subsection header.

This is the chart that describes the activities
of the system.

Note: Certain Interleaf commands, such as <sect> and <subsect>, that are written in a verbatim environment must start at the extreme left of the line. Otherwise, the formatter does not correctly interpret them). Do not be misled into indenting these commands in the desire to produce a more readable template.

In the case of the activity chart plot, you follow a slightly different formatting logic from that of nroff because Interleaf has a graphics capacity. Therefore, you do not have to leave space for the plot—the language automatically prepares the page for this. To include the plot in the output file, you supply an empty string as the second parameter in the Include Plot statement. This causes the plot information to be passed directly to the output segment. Note that the ninth parameter is ’interleaf’, which specifies the output language in which the plot is generated. Upon formatting, Interleaf interprets the plot graphics and draws it into the document.

For an explanation of the other parameters of this plot, see the stm_plot function.

Now you are ready to include the property report for the subactivities. First, you include another section of formatting commands to be passed verbatim to the output segments. These include instructions for a new page, a subheading, and a sentence introducing the property report. Next, you assign a value to the variable ac_list, which represents the subactivities of the subject activity. This is followed by an Include Property Report statement. This statement causes the property report to appear in the output segment before formatting, with its Interleaf commands embedded in the text. The Documentor embeds Interleaf commands because you attached the template to the Interleaf formatter at the Create Template stage. Upon formatting, these commands are interpreted along with the rest of the formatting commands. The final output is very similar to the document in Overview of Documentor (but there are differences in the appearance of the headings).