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.

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")
Note: 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:
  • For values 20 and greater, the traffic light is red red traffic light
  • For values 10 - 19, the traffic light is yellow yellow traffic light
  • For values less than 10, the traffic light is green green traffic light
  • When no value is entered, the traffic light is black black traffic light

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 Configure > Modules > Prefix Attribute.

The traffic light colors are the prefixes of the element titles


Feedback