summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortang peng <tang.peng5@zte.com.cn>2018-08-24 02:17:26 +0000
committerGerrit Code Review <gerrit@onap.org>2018-08-24 02:17:26 +0000
commit425eb3a7daf8820688a1f1d633e3021905732e82 (patch)
treed081d19e10600128cde7a315bd11c5ca62f894bd
parent6e26bf0b71a8b8493fbd1575717a2c5e539f93ee (diff)
parent78f3a322be51b30674968ad241a00d566e1fc179 (diff)
Merge "Optimized CCVPN Rules"
-rw-r--r--rules/ccvnp-rule.drl65
1 files changed, 37 insertions, 28 deletions
diff --git a/rules/ccvnp-rule.drl b/rules/ccvnp-rule.drl
index afc4c06..e1bfc8a 100644
--- a/rules/ccvnp-rule.drl
+++ b/rules/ccvnp-rule.drl
@@ -115,33 +115,40 @@ rule "Update AAI Information"
when
$a: VesAlarm(eventName.indexOf("Fault_Route_Status") != -1)
then
- updateAaiStatus (
- getAdditionalField($a, "networkId"),
- getAdditionalField($a, "node"),
- getAdditionalField($a, "tp-id"),
- getLogicLink($a),
- getAdditionalField($a, "oper-status")
- );
+ updateAaiStatus (
+ getAdditionalField($a, "networkId"),
+ getAdditionalField($a, "node"),
+ getAdditionalField($a, "tp-id"),
+ getLogicLink($a),
+ getAdditionalField($a, "oper-status")
+ );
end
rule "Set Up Correlation"
no-loop true
salience 200
when
- $a: VesAlarm($id: eventId, $start: startEpochMicrosec, eventName.indexOf("Fault_Route_Status") != -1)
- $b: VesAlarm(eventId != $id, eventName.indexOf("Fault_Route_Status") != -1, Math.abs(startEpochMicrosec - $start) < 60000)
+ $a: VesAlarm($id: eventId,
+ $start: startEpochMicrosec,
+ eventName.indexOf("Fault_Route_Status") != -1)
+ $b: VesAlarm(eventId != $id,
+ eventName.indexOf("Fault_Route_Status") != -1,
+ Math.abs(startEpochMicrosec - $start) < 60000)
then
- if (isCorrelated($a, $b)){
- // If any of the alarms have been marked as root, a policy message has ever been created and sent. Do NOT send it again.
- if ($a.getRootFlag() != 1 && $b.getRootFlag() != 1) {
- PolicyMsg msg = createPolicyMsg($a);
- DmaapService dmaapService = ServiceLocatorHolder.getLocator().getService(DmaapService.class);
- dmaapService.publishPolicyMsg(msg, "unauthenticated.DCAE_CL_OUTPUT");
- }
- $a.setRootFlag(1);
- $b.setRootFlag(1);
- update($a);
- update($b);
+ if ("down".equalsIgnoreCase(getAdditionalField($a, "oper-status"))
+ && "down".equalsIgnoreCase(getAdditionalField($b, "oper-status"))) {
+ if (isCorrelated($a, $b)){
+ // If any of the alarms have been marked as root, a policy message has ever been created and sent. Do NOT send it again.
+ if ($a.getRootFlag() != 1 && $b.getRootFlag() != 1) {
+ PolicyMsg msg = createPolicyMsg($a);
+ DmaapService dmaapService = ServiceLocatorHolder.getLocator().getService(DmaapService.class);
+ dmaapService.publishPolicyMsg(msg, "unauthenticated.DCAE_CL_OUTPUT");
+ }
+ $a.setRootFlag(1);
+ $b.setRootFlag(1);
+ update($a);
+ update($b);
+ }
}
end
@@ -149,14 +156,16 @@ rule "Clear Alarms"
no-loop true
salience 100
when
- $a: VesAlarm(alarmIsCleared == 1, eventName.indexOf("Fault_Route_Status") != -1)
+ $a: VesAlarm(eventName.indexOf("Fault_Route_Status") != -1)
then
- if (DmaapService.alarmUniqueRequestID.containsKey($a.getEventId())) {
- DmaapService.alarmUniqueRequestID.remove($a.getEventId());
+ if ("up".equalsIgnoreCase(getAdditionalField($a, "oper-status"))) {
+ if (DmaapService.alarmUniqueRequestID.containsKey($a.getEventId())) {
+ DmaapService.alarmUniqueRequestID.remove($a.getEventId());
+ }
+
+ //TODO: send alarm clearing message to Policy - for now it's not needed.
+ //...
+
+ retract($a);
}
-
- //TODO: send alarm clearing message to Policy - for now it's not needed.
- //...
-
- retract($a);
end \ No newline at end of file