I am very new to JBoss rules and I am trying to use it
for evaluating alert conditions.
I am asserting the AlertDefinition object as a fact
into the working memory.
The rules file would define a variety of alert
rule "Device not working (condition id = 4)"
# the if part
alertDefinition : AlertDefinition (conditionID
eid : entityID)
# here i would like to get the last power
reading from device
# with id == eid
eval (dao.getPower(eid).doubleValue() < 1000)
# then get temperature from the device
eval ((dao.getTemperature(eid) != null &&
dao.getTemperature(eid) > 50)
|| (dao.getAmbTemperature(eid) != null &&
dao.getAmbTemperature(eid) > 40)
# what do we do if the rule evaluates to true
log("Triggered Device not working alert for "
Here are my questions:
1. Am using the evals correctly? Can I possibly split
this into multiple rules to make it work better?
2. Can assign dao.getTemperature(eid) to a field. The
getTemperature call is expensive and doing it twice is
Any pointer would be appreciated.
Show replies by date