Comments (5)
Just to be more specific, we don't resolve to a true/false on running a number of rules, rather we have the option of true/false, as before (let's keep this backward compatibility) but also accept the outcome within a weight or score on success/failed events or conditions. Including options down the road to have deviation or range based on operators. That is if you define a range of lat/lon, should we not have an operator that gives back a weight (if defined) based on 5km or 20km difference?
That is Json-rules-engine would return in higher order the 5km then the 20km, or a result by priority.
Questions and input required, do we implement this a layer above or is json-rules-engine users interesting in adding these extra features.
from json-rules-engine.
Building weights or scores into the engine would only be used by a small subset of implementations, and json-rules-engine
is meant to be as general-purpose as possible. I agree with your suggestion that this is best suited as an extension of json-rules-engine
, in a separate package.
from json-rules-engine.
@alank64 did you end up extending the engine to support this or figure out a way to go about this that you liked? I have a use case for this too.
Right now I think I have two options, override the Condition class to support a weight property or manually re-traverse the successful conditions in an onSuccess callback. Though I'd prefer to do the former (so that weight tabulation is done at eval time), I'm leaning towards the latter in the interest of getting a feature out.
from json-rules-engine.
@dpickett this was a while ago, I might have gotten around it by adding weights in the configurations, if you want to review my old project online, and I'm curious also as to what you are doing, my skype is alank64 or search for Andrew Lank... meanwhile I'll try to bring back the old code and review.
from json-rules-engine.
I similarly ended up working around it. I added a weight property to the rule and then had to write a routine that recursively traverses the conditions in an onSuccess
hook. It works decently but I filed #216 in the hopes that I can more efficiently get the ruleResult
after a run.
from json-rules-engine.
Related Issues (20)
- Operator availability - between operator HOT 1
- OnSuccess/OnFailure properties as part of the rule - Security Issue
- Slow performance while having large array of facts. HOT 9
- How to feed engine multiple facts as array! HOT 1
- Complex rule for the fact HOT 2
- woops HOT 1
- Feat: Type-safety using a FactTypeMapping HOT 1
- Is it possible to make sure that a fact triggers at most one rule? HOT 2
- Uncaught TypeError: (0 , _hashIt2.default) is not a function HOT 8
- Error: Cannot find module 'lodash' HOT 1
- problems with the execution of my rules HOT 4
- Example issue - undefined parameter HOT 1
- RuleResult class missing from type declarations HOT 1
- What the best way to launch the rule engine
- Parent child rule
- Ability to stop rules execution after success for array of inputs
- How to create multiple 'aggregate' facts on a 'parent' object calculated from child objects (composition)
- BigInt value is not working
- Rule Evaluation taking around 10,000-15,000 ms for around 10k rules.
- Is the project providing an official JSON Schema to validate rules edition?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from json-rules-engine.