Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

A Concrete Sample of Holmes Rules

Info

The data structure shown below may vary according to the changes of the VES standard. Actually it is used only internally in Holmes. Other projects do not have to care about it.

Code Block
languagejava
linenumberstrue
public class VesAlarm {
    private String eventId;
    private String sourceId;
    private String specificProblem;
	private long alarmRaisedTime;
     
    // getters and setters are ommitted for brevity
    ...
}

...

Code Block
languagejava
linenumberstrue
package dcae.ves.test
import org.onap.some.related.packages;
 
// Alarm codes and specific problems used in the following rules:
// specificProblemID   specificProblem
// 4271                LSS_externalLinkDown
// 4272                LSS_failedAttachReqsRateExceeded
// 121297              LSS_cpiPCSCFFailReg
// 120267              LSS_cpiSIPRetransmitInvite
 
// the entity of the rule
rule "SameVNF_Relation_Rule"  
salience 120
no-loop true
	when
		$root : VesAlarm(  									
			$sourceId: sourceId, sourceId != null && !sourceId.equals(""),
			specificProblem in ( "LSS_cpiPCSCFFailReg(121297)", "LSS_cpiSIPRetransmitInvite(120267)" ),
			$eventId: eventId)									
		$child : VesAlarm( eventId != $eventId, 
			CorrelationUtil.getInstance().isTopologicallyRelated(sourceId, $sourceId),
			specificProblem in ("LSS_externalLinkDown(4271)","LSS_failedAttachReqsRateExceeded(4272)"),
			this after [-60s, 60s] $root)				    	
	then					
		DmaapService.publishResult(...);		
end