kislayverma / rulette Goto Github PK
View Code? Open in Web Editor NEWA pragmatic business rule management system
Home Page: http://rulette.org
License: Apache License 2.0
A pragmatic business rule management system
Home Page: http://rulette.org
License: Apache License 2.0
The current lookup complexity of valid range input lookup in rule evaluation is O(n) as the engine iterates over all ranges to find matches. Evaluate using alternate data structure to improve this.
These classes should only be used for testing, so we should move them to separate testing only module so that all modules can use them.
Found this issue by #59
The only way to do this right now is to getRawValue() and split on '-' which is just clumsy. We need to devise a way which is cleaner than this and still consistent across both value and range inputs.
The current way of defining ranges by saying "0-500", "a-z" is ugly. It would be a lot better to store the upper and lower bounds in 2 different columns of the rule table.
Steps to reproduce:
sample-rulesystem-setup.sql
script.SimpleMysqlUse
class.[main] INFO com.github.kislayverma.rulette.example.mysql.SimpleMysqlUse - ==========Update a rule==========
Exception in thread "main" java.lang.Exception: The rule to be deleted and the rule found are not the same.Something went horribly wrong
at com.github.kislayverma.rulette.engine.impl.trie.TrieBasedEvaluationEngine.deleteRule(TrieBasedEvaluationEngine.java:157)
at com.github.kislayverma.rulette.RuleSystem.updateRule(RuleSystem.java:240)
at com.github.kislayverma.rulette.example.mysql.SimpleMysqlUse.updateRule(SimpleMysqlUse.java:129)
at com.github.kislayverma.rulette.example.mysql.SimpleMysqlUse.runSamples(SimpleMysqlUse.java:110)
at com.github.kislayverma.rulette.example.mysql.SimpleMysqlUse.run(SimpleMysqlUse.java:46)
at com.github.kislayverma.rulette.example.mysql.SimpleMysqlUse.main(SimpleMysqlUse.java:35)
From my debugging, I believe the cause of this to be these identical rules in sample-rulesystem-setup.sql
script:
(192,'WES',3,NULL,NULL,NULL,'4'),(196,'WES',3,NULL,NULL,NULL,'4')
Proposed fix: Use NULL
as the source_state
for ruleId 196.
We should be able to specify ranges going till infinity
The setup and example SQL scripts under the. mysql provider are the latest ones. All other modules have outdated setup files as examples.
@kislayverma Do we have a plan/vision to extend to NoSQL DB ? We can start from MongoDB.
We should have first class support for boolean rule inputs instead of having to interpret "1","0", "true" etc as boolean representations
Using non-numbers (string, date etc) results in NumberFormatException
Instead of rule inputs being fixed values, we should allow them to be arbitrarily executable pieces of code. This will allow definition of custom logic instead of static values.
A few things to consider here.
This is also a significant deviation from the current simple approach of Rulette towards rule inputs, viz that of treating them as stored "values". With this, we shift more towards Drools style rule "execution", although we may be able to support both modes.
The only way to do this right now is to check for NULL or "". This leaks out implementation detail of what constitutes 'Any', in addition to making the calling code ugly and fragile.
We should build a better interface to this info (maybe via a 'isAny()' method on rule input class)
The rule engine open a lot of connections pool to the database without closing them which cause the [Too many connections] exception
The update query built by the MySQL provider does not use the underlying upper-lower range bound columns of a range input. It tries to update it like a single column. Hence the update API is broken for any rule system containing range inputs.
Read the doc location - http://rulette.readthedocs.io/en/latest/
Great tool and very usefull , thank you
i think it will be better if the tool also provider the shared database multi tenancy modal, it's more performance than the multiple database schema
It should be read as 'Any'
This will help in the discovering all rule system when used under rulette-server
This will further reduce the dependency footprint and artifact size
Builds are getting triggered on Travis, but completion status is not updated on the PR
Since rule system data is now provided via an injected IDataProvider implementation, rulette-core should be independent of how this data is stored and retrieved.
This means that the injected implementation is mandatory, not optional as it is currently.
A rule_id (rule primary key) can be anything, and so should be treated as String
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.