Text and Property
When you want to output some text, you either use a <Text> or a <Property>.
You use <Text> when you want to output specific words, sentences or paragraphs, such as "Here is a list of business activities:". The following example show the use of <Text> in a template.
<ParagraphBreak/>
<IterationBlock allLevel="true" >
<Property property="name"/>
<Text> : </Text>
<Property property="modelType"/>
<ParagraphBreak/>
</IterationBlock>
The first <Text> in the example above outputs a sentence "Here is a list of elements in my project: ".
The second <Text> outputs a colon between the name and type of elements. Note that the space before and after the colon will get output into the document.
Here is the outcome of the example above.
Place Order : UseCase
PaymentController : Class
Cancel Order : BPTask
The following table lists the available attributes of <Text>.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Attributes of <Text> |
You may have noticed the use of <Property> in the example above. <Property> is another way to output text. You use <Property> when you want to output text by extracting the data from a property of querying diagram or element. The following example show the use of <Property> in a template.
<Text>Name: </Text>
<Property property="name"/>
<ParagraphBreak/>
<Property property="description"/>
<ParagraphBreak/>
<ParagraphBreak/>
</IterationBlock>
The first <Property> outputs the name of the querying element, while the second <Property> outputs the description.
Here is the outcome of the example above.
The process to check out a shopping cart and finish the payment.
Name: PaymentController
A controller class that handles the payment logic.
Name: Cancel Order
The process to delete an order made within the last 7 days.
The following table lists the available attributes of <Property>.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Attributes of <Property> |
Understanding Dynamic Heading Style
When you want to set a text produced by a <Text> or a <Property> to be a heading, add and specify the style attribute in the <Text> or <Property>.
There are two ways of specifying a heading – Static and Dynamic. The following example shows the static way of specifying heading:
<Property property="name" style="Heading 2"/>
The <Text> in the example above outputs a sentence "Text in heading 1", with Heading 1 as style. The <Property> outputs the name of a model element, with Heading 2 as style.
The static way of specifying heading requires you to provide the style name in the template.
In contrast to the static way, here is an example that shows the dynamic way of specifying heading:
<Property property="name" style="@heading+"/>
In the example above, we do not provide the name of the heading style. Instead, we use @heading to indicate the need to assign heading style, @heading+ to indicate an increase of heading style level. By using @heading, the style Heading 1...N will be used in the output document.
Here is the outcome of the example above.
Place Order Use Case
The sentence Text in heading 1 has Heading 1 applied, while the name Place Order Use Case has Heading 2 applied.
More about Heading Increment
By appending + to @heading, the leveling of heading style will be increased. For example, if the previous heading is a Heading 1, the use of @heading+ will output a heading in Heading 2.
The use of + in @heading is optional though. If you want to add a heading that has the same heading level as the previous heading, skip + to reuse the style used by the previous heading.
Related Resources
The following resources may help you to learn more about the topic discussed in this page.
2. Template Root | Table of Contents | 4. Looping (Non Connector) |