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 capability to return the first matching rule during bulk evaluation #24

Merged
merged 19 commits into from
Oct 27, 2022

Conversation

r0goyal
Copy link
Collaborator

@r0goyal r0goyal commented Oct 27, 2022

Currently HopeLangEngine support evaluating rules

  • one-by-one
  • bulk evaluation which will evaluate all rules irrespective of how many of them match

Many a times, a client would want to evaluate a bunch of rules and just wants to know if any of the rule matches instead of all the matching rules. This PR aims to add another public method for evaluation evaluateFirst to achieve the same. If any rule matches, that rule's index in the original list would returned otherwise an Optional.empty() would be returned

Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
@r0goyal r0goyal changed the title Added capability to return the first rule which matched evaluation during bulk evaluation Added capability to return the first matching rule during bulk evaluation Oct 27, 2022
@santanusinha santanusinha merged commit bf4de3d into master Oct 27, 2022
@santanusinha santanusinha deleted the eval_first branch October 27, 2022 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants