i use Jess rule engine with java and i have a template person with a number of facts. I excecute a rule concerning persons and i would like to get the number of facts that satisfy the rule and made it fire. Is this possible; e.g.Command engine.executeCommand("(run)") returns only 0 or 1 in case a rule fired
1
There are 1 best solutions below
Related Questions in RULE
- Why Confidence does not consider B in Association rule mining
- How to call Management API v2 to send verification mail from within a rule?
- yii2 conditional validation is not working serverside?
- Sonarqube rule deactivation is not working
- Drools rule not true, how to use 'and'?
- add RDFS inference rules support in endpoint SPARQL
- JUnit rules TemporaryFolder - Error on Bamboo
- udev usb everytime different path
- How to use collect() in drools in this scenario
- Writing a Prolog Rule
- Magento shopping cart rule, Can I create discount base on category and quantity?
- netsh command returning unrecognized error, unknown reason
- Using modrewrite to rewrite multiple urls
- Conditional rule on Insert in Postgresql
- How to implement rule If I want to execute only one rule rather than execute all rules in Drools Rule Engine?
Related Questions in JESS
- JESS vs DROOLS : Backward chaining
- Jess pattern matching 'not' condition on rule
- Passing Values from Java to Jess
- How to use Jess in Android Studio
- Jess rule definition
- Jess and invocation of overloaded Java static methods
- reading text file in jess rule engine
- Jess issue about facts and rules
- Rule conflict in Jess rule engine
- Java reflection vs Jess
- Program Highlightning .clp files?
- Jess: define a rule with "not" syntax
- JessTab: Finding average value
- JessTab: Finding the youngest person in family ontology
- Jess in php code how?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Depending on what exactly you need, there are several things you might do. The function
(run)actually returns the number of rules that fired, so if each fact activates one rule, then the return value of(run)would do it.If you need to do anything more complex, then you can register a
JessEventListenerto be notified when each rule fires. TheJessEventwill contain the whole activation record for the rule, so you can walk through it and count the facts however you like. Since rules can match the non-existence of facts, or the existence of at least one fact that fits a pattern, etc, the question of "how many facts activated a rule" isn't completely straightforward. But with the activation record in hand, you can count them however you like.