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

How can i write dynamic rules to execute rather than writing in java program .like rules defined in JSON or Yaml? #191

Open
evasanthan opened this issue Apr 21, 2020 · 4 comments

Comments

@evasanthan
Copy link

I liked the rulebook concept which is really great library. but

Do we have any option dynamically add rules and conditions in Yaml or JSON rather than writing all rules in POJO or programmatically?...

@awattez
Copy link
Contributor

awattez commented May 8, 2020

I do not think that this library is planned to use JSON / YAML files to configure the rules.
I also do not know if there is a RoadMap referenced somewhere, maybe this request can be registered there.
This library can probably help you https://github.com/j-easy/easy-rules

@lospejos
Copy link

lospejos commented Jun 3, 2020

I'm not sure that library mentioned above (easy-rules) has something that this library doesn't. Both libraries has examples of dynamically created rules in runtime. Since you can create rules in runtime, you can parse rules from XML, JSON, YAML, database tables or whatever you want and create rules accordingly. The main challenge is to create a flexible rules description format (especially when you plan to create complex rules combined from conditions set joining them using AND, OR, NOT etc), and to create a error-prone parser of this format.

All written above is just my opinion, of course )))

@Clayton7510
Copy link
Collaborator

Clayton7510 commented Oct 15, 2020

JSON, XML or YAML support is not on the roadmap. I agree that if that's specifically what you are looking for, then something like easy-rules might be worth a look.

I don't really like how that was supported in other frameworks - feels like a move away from simplicity. With that being said, there always were plans to have rules loaded at runtime that could be stored somewhere else, but rules that are in an intuitive DSL, like something that could be provided by Groovy or maybe Kotlin. Not a simple task, tho.

@Clayton7510
Copy link
Collaborator

This thread is scheduled to be deleted on 10/22/2020. Further discussion on externalized rules can be handled in issue #9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants