Setting the alarm counters

JViews TGO offers two approaches to setting the alarm counters:
It is possible to combine the two computation models, having JViews TGO compute the alarm counters for some managed objects and the back end for the other managed objects.

The back end computes the alarm state counters

To set the counters:
  1. Remove from the data source all alarms related to the managed object.
  2. Set the computedFromAlarmList property of the alarm state to false .
  3. Retrieve the counters from the back end and set the values in the alarm state.
To update the counter values according to changes in the back end:
  1. Subscribe to the notification of alarm counter changes by the back end.
  2. Update the alarm counter in the alarm state according to the back-end notifications.

JViews TGO computes alarm state counters

JViews TGO can compute alarm state counters for a given managed object based on the list of alarms for this object.
To set the counters:
  1. Use an IltDefaultDataSource for the data source.
  2. Set the computedFromAlarmList property of the alarm state to true .
  3. Retrieve the list of alarms for the managed object and create the corresponding IltAlarm objects. In the IltAlarm objects, set the managedObjectInstance attribute value to the object identifier of the managed object.
  4. Add the IltAlarm objects in the same data source as the IltObject corresponding to the managed object.
To update the alarm state according to changes in the back end:
  1. Subscribe to the notification of alarms and alarm list changes for the object.
  2. Add, remove or update the IltAlarm business objects according to the changes.
The handlingAlarmReferences property of IltDefaultDataSource controls whether the alarm state consolidation occurs or not in a given data source. By default the consolidation is active.

Combining alarm counter computation models

You can have JViews TGO compute the alarm counters for some managed objects, and the back end compute the counters for the other managed objects. You can also switch from one computation model to the other for a given managed object.
Note
The concurrent use of the two models on the same managed object would result in inconsistent and inaccurate counters. Use IltAlarm.State.setComputedFromAlarmList to switch between the two modes. When the alarm counters are computed from the associated list of alarms, attempts to change the alarm counters directly with the alarm state APIs would trigger an IllegalStateException . Instead, update the associated IltAlarm objects.

How to switch from alarm counters computed by the back end to alarm counters computed by JViews TGO

  1. Unsubscribe to the notification of alarm counter changes by the back end.
  2. Disable the automatic alarm counter computation of the alarm state using the method IltAlarm.State.setComputedFromAlarmList . This will reset the counters to zero.
  3. Retrieve the list of alarms for the managed object and create the corresponding IltAlarm objects. In the IltAlarm , set the ManagedObjectInstanceAttribute value to the object identifier of the managed object.
  4. Add the IltAlarm objects in the same data source as the IltObject corresponding to the managed object.
  5. Subscribe to alarm list change notifications by the back end.
  6. Add, remove or update IltAlarm objects according to the back-end notifications.

How to switch from alarm counters computed by JViews TGO to alarm counters computed by the back end

  1. Unsubscribe to the notification of alarm list changes by the back end.
  2. Remove from the data source all the alarms related to the managed object.
  3. Enable the automatic alarm counter computation of the alarm state using the method IltAlarm.State.setComputedFromAlarmList . This will reset the counters to zero
  4. Retrieve the counters from the back end and set the values in the alarm state.
  5. Subscribe to the notification of alarm counter changes by the back end.
  6. Update the alarm counters in the alarm state according to the back-end notifications.