Chapter 4 Managing Profiles
Once you have defined the template used to evaluate each message sequence number, you have to create a template to sort these sequence numbers (compareCbMsgSymbols
), and another template to retrieve all messages from the collaboration diagram (description
).
The template compareCbMsgSymbols
is a boolean that allows verifying if a message number is greater than another message number. The syntax of this template is the following:
.bool (%Item1.Object.SequenceNumber% >= %Item2.Object.SequenceNumber%)
The returned value for this template is used with parameter compare in template description
which code is the following:
Collaboration Scenario %Name%: \n .foreach_item(Symbols,,, %ObjectType% == CollaborationMessageSymbol, %compareCbMsgSymbols%) %Object.description% .next(\n)
In this template, the first line is used to generate the title of the scenario using the name of the collaboration diagram %Name%. Then it creates a new line.
Then the macro for each item loops on each message symbol, verifies and sorts the message number, and outputs the message description using the syntax defined in previous section.
To define templates for the collaboration diagram metaclass:
.bool (%Item1.Object.SequenceNumber% >= %Item2.Object.SequenceNumber%)
Collaboration Scenario %Name%: \n .foreach_item(Symbols,,, %ObjectType% == CollaborationMessageSymbol, %compareCbMsgSymbols%) %Object.description% .next(\n)
Copyright (C) 2005. Sybase Inc. All rights reserved. |