Attributes for KPI Widgets

KPI widgets are configured in the type kpiWidget or one of its subitems. They can make use of the following attributes: 

The following code provides an example of a KPI widget script:

import com.consol.cmas.common.model.ticket.*

import java.util.*

import com.consol.cmas.common.model.DateRange

TicketCriteria crt = new TicketCriteria()

def to_date = new Date()

def from_date = to_date - 7

def range = new DateRange(from_date,to_date)

crt.setCreationDateRange(range)

// crt.setStatus(TicketCriteria.Status.OPEN)

ticketcount = ticketService.getByCriteria(crt).size()

switch (ticketcount) {

case 0..25:

trendline = 'down'

break

case 26..50:

trendline = 'flat'

break

default:

trendline = 'up'

}

return[value: ticketcount as String, trend: trendline, visible: 'true']

Code example 34: Admin Tool script for a KPI widget which calculates the tickets which have been opened during the last week

The widget will be displayed in the Web Client as shown in the following figure.

Figure 288: ConSol CM Web Client - KPI widget on Dashboard page