Skip to content

Commit

Permalink
Merge pull request #35 from gerrieg/channel
Browse files Browse the repository at this point in the history
Added eq and neq to channel event
  • Loading branch information
seaside1 authored May 11, 2022
2 parents 332dde3 + a7350cb commit ee3fbfc
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,8 @@ jRuleEventPresent, getDoubleFromAnnotation(jRuleWhen.lt()),
JRuleLog.info(logger, logName, "Validating JRule channel: {} trigger: {} ", jRuleWhen.channel(),
jRuleWhen.trigger());
addChannelExecutionContext(jRule, logName, jRuleWhen.channel(), jRuleName.value(), method,
jRuleEventPresent, preconditions);
jRuleEventPresent, getStringFromAnnotation(jRuleWhen.eq()),
getStringFromAnnotation(jRuleWhen.neq()), preconditions);
}
}
}
Expand Down Expand Up @@ -323,11 +324,11 @@ private void addExecutionContext(JRule jRule, String logName, String itemClass,
}

private void addChannelExecutionContext(JRule jRule, String logName, String channel, String ruleName, Method method,
boolean eventParameterPresent, JRulePrecondition[] preconditions) {
boolean eventParameterPresent, String eq, String neq, JRulePrecondition[] preconditions) {
List<JRuleExecutionContext> contextList = channelToExecutionContexts.computeIfAbsent(channel,
k -> new ArrayList<>());
final JRuleExecutionContext context = new JRuleExecutionContext(jRule, logName, null, null, null, null,
ruleName, null, null, method, eventParameterPresent, null, null, null, null, null, null, preconditions);
ruleName, null, null, method, eventParameterPresent, null, null, null, null, eq, neq, preconditions);
JRuleLog.debug(logger, logName, "ChannelContextList add context: {}", context);
contextList.add(context);
}
Expand Down

0 comments on commit ee3fbfc

Please sign in to comment.