Skip to content
This repository has been archived by the owner on May 7, 2020. It is now read-only.

Commit

Permalink
Trigger rules without specific event on any event (#3366)
Browse files Browse the repository at this point in the history
* Trigger rules without specific event on any event, Fixes #3362
* Simplified nested if

Signed-off-by: Stefan Triller <stefan.triller@telekom.de>
  • Loading branch information
triller-telekom authored and sjsf committed May 4, 2017
1 parent 55fd9c9 commit e320f02
Showing 1 changed file with 5 additions and 4 deletions.
Expand Up @@ -217,10 +217,11 @@ public Iterable<Rule> getRules(TriggerTypes triggerType, String channel, String
for (EventTrigger t : rule.getEventtrigger()) {
if (t instanceof EventEmittedTrigger) {
EventEmittedTrigger et = (EventEmittedTrigger) t;
if (et.getTrigger() != null) {
if (et.getChannel().equals(channel) && et.getTrigger().equals(event)) {
result.add(rule);
}

if (et.getChannel().equals(channel)
&& (et.getTrigger() == null || et.getTrigger().equals(event))) {
// if the rule does not have a specific event , execute it on any event
result.add(rule);
}
}
}
Expand Down

0 comments on commit e320f02

Please sign in to comment.