Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added eq and neq to channel event #35

Merged
merged 1 commit into from
May 11, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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