Administering : Managing business rules and expressions : Business rule definition examples : TrafficLight example
  
TrafficLight example
In this example, the TrafficLight business rule is used to indicate whether the value of the time attribute is in scope according to the estimated time.
The Requirements module contains an accumulated time attribute of the Integer type. When users add to this attribute, you want to indicate whether the value is in scope according to estimated time.
1 To set up the TrafficLight business rule, in the business rule container attribute, enter the following business rule:
=TrafficLight('Accumulated Time',"10","20","Red","Yellow","Green")
2 If you click Evaluate Expression, the text of the corresponding traffic light color is displayed.
When the Accumulated Time attribute is changed, the TrafficLight business rule is updated and displays a different color depending on the value in the attribute:
Values
Colour
Values 20 and greater
red traffic light
Red
Values 10 - 19
yellow traffic light
Yellow
Values less than 10
green traffic light
Green
No value
black traffic light
Black
3 If you set the container attribute TrafficLight as a Prefix attribute for the module, the traffic light status is displayed with the element title. To set TrafficLight as a Prefix attribute, click the Settings icon Settings icon and then, from the Configure group, click Modules. Click Prefix Attribute.
The traffic light colors are the prefixes of the element titles
See also
TrafficLight business rule
Business rule definition examples