2022-02-09 19:19:09 +01:00
import eu.hsrw.ias.ggd.Notification;
import eu.hsrw.ias.ggd.Severity
import HttpCall.HttpPost;
2022-03-02 17:15:00 +01:00
rule "Green House Critical"
when
warning: Notification(severity > Severity.Warning)
then
HttpPost httpPost = new HttpPost();
2022-04-06 09:59:48 +02:00
final String criticalGreenhouse = String.format("{\"id\":\"nica-greenhouse-status\",\"data\":{\"measured\":[{ \"status\": \"The status of the greenhouse is critical\"}]}}");
2022-03-02 17:15:00 +01:00
httpPost.HttpCallPost("http://connector.dev.whysor.com/default/insert?access_token=3hosOhAeh4k0XmcuAMQGfYldvTuQDvtAj2PJJ4irKPBefD5Ijij6gnUkLtVLd4fW",criticalGreenhouse);
System.out.println(criticalGreenhouse);
System.out.println("Green House critical, because of: '"+warning.getType()+"'");
end