...
Code Block |
---|
rule mischief_hat_lifted { select when mischief hat_lifted foreach Subscriptions:getSubscriptions() setting (subscription) pre { subs_attrs = subscription{"attributes"} } if subs_attrs{"subscriber_role"} == "thing" then event:send( { "eci": subs_attrs{"outbound_eci"}, "eid": "hat-lifted", "domain": "mischief", "type": "hat_lifted" } ) } |
Notice that the rule evaluates for each of the subscriptions. It only acts for those subscriptions with a subscriber_role
of "thing", and is able to reach that pico through the outbound_eci
which was established when the subscription was accepted.
Deleting subscriptions
(to be written)
...