2021-12-13 10:12:44 +01:00
import eu.hsrw.ias.ggd.Notification;
2021-12-14 14:52:02 +01:00
import eu.hsrw.ias.ggd.Severity
import HttpCall.HttpPost;
2021-12-13 10:12:44 +01:00
rule "Green House Critical"
when
warning: Notification(severity > Severity.Info)
then
2021-12-14 14:52:02 +01:00
HttpPost httpPost = new HttpPost();
final String criticalGreenhouse = String.format("{\"id\":\"germes-greenhouse-status\",\"data\":{\"measured\":[{ \"status\": \"The status of the greenhouse is critical\",}]}}");
httpPost.HttpCallPost("http://connector.dev.whysor.com/default/insert?access_token=3hosOhAeh4k0XmcuAMQGfYldvTuQDvtAj2PJJ4irKPBefD5Ijij6gnUkLtVLd4fW",criticalGreenhouse);
System.out.println(criticalGreenhouse);
2021-12-13 10:12:44 +01:00
System.out.println("Green House critical, because of: '"+warning.getType()+"'");
2021-12-14 14:52:02 +01:00
2021-12-13 10:12:44 +01:00
end