To calculate the sum of an attribute value in selected
elements from a linklist or incoming links attribute, you can use
the List AttributeSum business rule. In this example, a project manager
uses the ListAttributeSum business rule to calculate the total cost
for the implemented business needs in a project.
As a project manager, you must monitor the total cost
of the business needs implemented in your project. New or planned
business needs might also be linked to your project, but for this
particular purpose, you are interested only in implemented business
needs. Implemented business needs have the status To be tested, Verified,
or Completed.
To include only the implemented business
needs in the calculation, use a view that is based on the To be tested,
Verified, and Completed statuses. By adding listen_to parameters,
the total cost of the project is automatically recalculated when the
cost or status are updated in a linked business need.
Important: The data in this topic is an example. When you set
up this business rule, the attribute IDs, view ID, and user ID must
be collected from your current installation of IBM® Rational® Focal Point™.
This
example uses the following attributes, view definition, and user:
Table 1. Attributes| Module |
Attribute name |
Attribute type |
ID |
Comment |
| Projects |
Total Cost |
Integer |
Not used |
This attribute is the business rule container. |
| Projects |
Business Needs |
Incoming Link |
51 |
The Incoming Link attribute displays links from
elements in the Business Needs module, and might contain links to
business needs of any status. |
| Business Needs |
Cost |
Integer |
23 |
|
| Business Needs |
Status |
Choice |
Not used |
The choice items might include New, Planned,
To be tested, Verified, and Completed. This attribute is used for
the view. |
Table 2. View definition| View name |
Module |
Visible attributes |
View rules |
View ID |
| Implemented Business Needs |
Business Needs |
|
type is a folder is false AND Status is (To
be tested OR Verified OR Completed) |
38 |
Table 3. User properties| User name |
Access level |
User ID |
| Admin |
Workspace administrator |
46 |
To view the total cost for the implemented business needs
in this example, enter this business rule in the
Total
Cost attribute in the Projects module:
=ListAttributeSum("51","38", "23", "46", 'Business Needs', "listen_to=Cost", "listen_to=Status", "listen_to=type is a folder")