skip to main content
TGO > Programmers documentation > Styling > Customizing object states > Customizing alarm severities
 
Customizing alarm severities
JViews TGO provides the concept of alarm to represent specific conditions in a managed object.
Alarms are represented graphically using alarm balloon and alarm count decorations. JViews TGO distinguishes raw alarms (generated and carried by an object) from impact alarms (propagated to an object). A telecom object can have raw and impact alarms at the same time, which introduces the concepts of primary and secondary alarm states. The primary alarm state has a more detailed representation than the secondary alarm state. By default, the primary alarm state is the raw alarm state. The choice of the primary alarm state can be customized by the CSS properties listed in the following table.
CSS properties for the primary and secondary alarm states 
Property Name
Type
Default Value
Used by IltObject in
Description
primaryAlarmState
ilog.tgo.model.IltAlarmStateEnum
Raw
network
Determines whether the primary alarm state is carried by the raw alarms or by the impact alarms. The secondary alarm state is represented as a secondary icon.
Possible values are:
- Raw
- Impact
listPrimaryAlarmState
Boolean
false
network
Determines whether the object primary alarm state is displayed in the information window.
listSecondaryAlarmState
Boolean
true
network
Determines whether the object secondary alarm state is displayed in the information window.
listAlarmStateAbbreviated
Boolean
false
network
Determines whether the alarm state information listed in the information window displays alarm severities using their abbreviation or their description.
For more information, refer to Alarms and Alarm states in the Business objects and data sources documentation.
How to create new alarm severities (using the API)
In the following example, a new raw alarm severity named “Informational” is created with the following properties:
*A unique name, used to identify the alarm severity in the Alarm system.
*A short description used by the alarm count.
*A severity index, used to define the priority of the new alarm severity in the Alarm severity enumeration.
The new alarm severity is positioned before the Unknown severity in the IltAlarm.Severity enumeration.
 
IltAlarm.Severity infoSeverity =
    new IltAlarm.Severity("Informational",
                          IltAlarm.Severity.Unknown.getSeverity()/2);
To create a new impact alarm severity use the IltAlarm.ImpactSeverity enumeration instead of IltAlarm.Severity.
How to create new alarm severities (using CSS)
You can also create new raw and impact alarm severities by using global CSS settings:
 
Settings {
   alarm: true;
}
Alarm {
   severities[0]: @+severity0;
   impactSeverities[0]: @+impactSeverity0;
}
Subobject#severity0 {
  class: 'ilog.tgo.model.IltAlarm.Severity';
  name: "Informational";
  severity: 210;
}
Subobject#impactSeverity0 {
  class: 'ilog.tgo.model.IltAlarm.ImpactSeverity';
  name: "InformationalLow";
  severity: 220;
}
How to customize alarm severities
Alarms are represented in the business objects using the following graphical cues:
*A color associated with the object base.
*An alarm count displayed on the object base.
*A colored alarm balloon displaying another alarm count.
*A colored outline displayed around the object base.
For information on how these graphical cues are used in JViews TGO, refer to
When a new alarm severity is created, the properties used to customize the graphical cues need to be defined. These properties are:
*A short description used by the alarm count.
*An expanded description used in the alarm balloon when the CSS property alarmBalloonCollapsed is false.
*A set of colors used when representing alarm conditions.
These properties are set as part of the JViews TGO look and feel, which can be customized using SetValue or global CSS settings.
The properties that affect the alarm severities are:
*<severity category>.<severity name>.Color
*<severity category>.<severity name>.BrightColor
*<severity category>.<severity name>.DarkColor
*<severity category>.<severity name>.Abbreviation
*<severity category>.<severity name>.Description
*<severity category>.<severity name>.Icon
For the raw alarm severity created in How to create new alarm severities (using the API), the following properties will have to be defined:
*Alarm.Raw.Informational.Color
*Alarm.Raw.Informational.BrightColor
*Alarm.Raw.Informational.DarkColor
*Alarm.Raw.Informational.Abbreviation
*Alarm.Raw.Informational.Description
*Alarm.Raw.Informational.Icon (This property is optional.)
The following example shows how you should customize the new alarm severity using the API.
 
// Define the colors
Color myAlarmColor = new Color(127, 255, 212);
// aquamarine
Color myAlarmBrightColor = myAlarmColor.brighter();
Color myAlarmDarkColor = myAlarmColor.darker();
 
IltSettings.SetValue("Alarm.Raw.Informational.Color", myAlarmColor);
IltSettings.SetValue("Alarm.Raw.Informational.BrightColor",
myAlarmBrightColor);
IltSettings.SetValue("Alarm.Raw.Informational.DarkColor", myAlarmDarkColor);
IltSettings.SetValue("Alarm.Raw.Informational.Abbreviation", "i");
IltSettings.SetValue("Alarm.Raw.Informational.Description", "Informational");
You can then retrieve these values using GetValue.
The following example shows how to customize the new alarm severity using global CSS settings (you must specify the full alarm name, for example " Alarm.Raw.Informational " or " Alarm.Impact.InformationalLow " when matching the " name " attribute). The CSS properties to be customized are color, darkColor, brightColor, abbreviation, description, icon.
 
setting."ilog.tgo.model.IltAlarm.Severity"[name="Alarm.Raw.Informational"] {
  color: orange;
  darkColor: blue;
  brightColor: yellow;
  abbreviation: "i";
  description: "Informational";
  icon: '@|image("icon1.png")';
}
setting."ilog.tgo.model.IltAlarm.ImpactSeverity"[name="Alarm.Impact.Information
alLow"] {
  color: orange;
  darkColor: blue;
  brightColor: yellow;
  abbreviation: "IL";
  description: "InformationalLow";
  icon: '@|image("icon1.png")';
}
How to customize existing alarm severities
You can customize the representation of the existing alarm severities, for example, Raw.Critical or Impact.CriticalHigh. To do so, you use the same properties as listed in How to customize alarm severities:
*<severity category>.<severity name>.Color
*<severity category>.<severity name>.BrightColor
*<severity category>.<severity name>.DarkColor
*<severity category>.<severity name>.Abbreviation
*<severity category>.<severity name>.Description
*<severity category>.<severity name>.Icon (This property is optional.)
The following example shows how to customize the severity Impact.CriticalHigh using the API.
 
// Define the colors
Color myAlarmColor = Color.magenta;
Color myAlarmBrightColor = myAlarmColor.brighter();
Color myAlarmDarkColor = myAlarmColor.darker();
 
IltSettings.SetValue("Alarm.Impact.CriticalHigh.Color", myAlarmColor);
IltSettings.SetValue("Alarm.Impact.CriticalHigh.BrightColor",
myAlarmBrightColor);
IltSettings.SetValue("Alarm.Impact.CriticalHigh.DarkColor", myAlarmDarkColor);
IltSettings.SetValue("Alarm.Impact.CriticalHigh.Abbreviation", "CH");
IltSettings.SetValue("Alarm.Impact.CriticalHigh.Description", "Critical High");
The following example shows how to customize the severity Impact.CriticalHigh using global CSS settings (you must specify the full alarm name, for example " Alarm.Raw.Critical " or " Alarm.Impact.CriticalHigh " when matching the " name " attribute. The CSS properties to be customized are color, darkColor, brightColor, abbreviation, description, icon ):
 
setting."ilog.tgo.model.IltAlarm.Severity"[name="Alarm.Raw.Critical"] {
  color: orange;
  darkColor: blue;
  brightColor: yellow;
  abbreviation: "c";
  description: "Critical";
  icon: '@|image("icon1.png")';
}
setting."ilog.tgo.model.IltAlarm.ImpactSeverity"[name="Alarm.Impact.CriticalHig
h"] {
  color: orange;
  darkColor: blue;
  brightColor: yellow;
  abbreviation: "CH";
  description: "CriticalHigh";
  icon: '@|image("icon1.png")';
}
How to customize the Loss Of Connectivity representation
You can define the following settings to customize the representation of objects that have the state Loss of Connectivity set.
*Alarm.LossOfConnectivity.Color
*Alarm.LossOfConnectivity.BrighColor
*Alarm.LossOfConnectivity.DarkColor
*Alarm.LossOfConnectivity.Abbreviation
The following code extract shows you how to proceed using the API:
 
IltSettings.SetValue("Alarm.LossOfConnectivity.Color", Color.blue);
IltSettings.SetValue("Alarm.LossOfConnectivity.Abbreviation", "??");
The following example shows how to proceed using global CSS settings (you must specify the full alarm loss of connectivity name, for example " Alarm.LossOfConnectivity " when matching the " name " attribute. The CSS properties to be customized are color, darkColor, brightColor, abbreviation ):
 
setting."ilog.tgo.model.IltState"[name="Alarm.LossOfConnectivity"] {
  color: orange;
  darkColor: green;
  brightColor: yellow;
  abbreviation: "LOC1";
}
How to customize the Not Reporting representation
By default, objects in the Not Reporting state do not show any alarm information. They display the value "NR" instead of the current alarm count.
You can customize this representation using the setting Alarm.NotReporting.Abbreviation.
The following code extract shows you how to proceed using the API:
 
IltSettings.SetValue("Alarm.NotReporting.Abbreviation", "NR?");
The following example shows how to proceed using global CSS settings (you must specify the full alarm Not Reporting name, " Alarm.NotReporting " when matching the " name " attribute. The CSS property to be customized is abbreviation ):
 
setting."ilog.tgo.model.IltState"[name="Alarm.NotReporting"] {
  abbreviation: "NR1";
}

Copyright © 2018, Rogue Wave Software, Inc. All Rights Reserved.