rule-engine

Drools Rule format for firing only once

谁都会走 提交于 2019-12-07 23:20:39
问题 I'm using the drools 6 engine. Suppose I have an account object that has a collection of sections and each section has a status flag that can be "GOOD" or "BAD". If I was to write the following: rule "Check if account has a good subsection" when $account : Account() SubSection (status == "GOOD") from $account.getSubSections() then insertLogical(new AccountIsGood($account)); end I would expect this to simply add the logical rule AccountIsGood($account) if atleast one section was good. However,

How to get response from .clp(CLIPS) file?

◇◆丶佛笑我妖孽 提交于 2019-12-07 17:11:08
问题 I am trying to load .clp file in my iPhone application. For that I am using below code NSString *filePath = [[NSBundle mainBundle] pathForResource:@"autodemo" ofType:@"clp"]; environment = CreateEnvironment(); char *clipsFileChar = (char *)[filePath cStringUsingEncoding:NSASCIIStringEncoding]; Load(clipsFileChar); Reset(); Run(-1); NSString *evalS = [NSString stringWithFormat:@"(find-all-facts ((?f state-list)) TRUE)"]; char * evalStr = (char *)evalS; DATA_OBJECT obj;// = {0,-1}; // obj.type

Compile drools guided decision table into rules

懵懂的女人 提交于 2019-12-06 20:05:46
问题 I am wondering how I could use a guided decision table from the Drools Workbench inside a Java application using the drools runtime. The idea is that a user would work defining rules, processes and some decision tables in the workbench, which will be picked up by the drools runtime. Still, for some reason, I can't figure out how to execute this in drools, since it stored the table as a gdst file and it does not seem to compile to drools. With drools, is there a way to: - execute the gdst file

Drools Rule format for firing only once

Deadly 提交于 2019-12-06 07:28:07
I'm using the drools 6 engine. Suppose I have an account object that has a collection of sections and each section has a status flag that can be "GOOD" or "BAD". If I was to write the following: rule "Check if account has a good subsection" when $account : Account() SubSection (status == "GOOD") from $account.getSubSections() then insertLogical(new AccountIsGood($account)); end I would expect this to simply add the logical rule AccountIsGood($account) if atleast one section was good. However, it seems this does not simply check for one successful subsection and end the rule, but instead it

Method or pattern to implement a Business Rules Engine in a solution?

假如想象 提交于 2019-12-06 02:49:59
I am working in a young banking company. Our solution (.NET) has an important technical debt, so we refactor it following DDD principles. We are planning to use (a) Business Rules Engine(s). Business rules deal with accounting purposes, marketing purposes, risk purposes, legal stuff... we are planning to POC the BRE to be sponsored by the business. I am looking for some feedback by people who succeded in adopting a BRE, or, a combination of BREs? Are there tools to manage the BR repository? Is there any pattern that might help to separate processes and BR ? Do you know some authors who wrote

How to get response from .clp(CLIPS) file?

回眸只為那壹抹淺笑 提交于 2019-12-06 00:58:45
I am trying to load .clp file in my iPhone application. For that I am using below code NSString *filePath = [[NSBundle mainBundle] pathForResource:@"autodemo" ofType:@"clp"]; environment = CreateEnvironment(); char *clipsFileChar = (char *)[filePath cStringUsingEncoding:NSASCIIStringEncoding]; Load(clipsFileChar); Reset(); Run(-1); NSString *evalS = [NSString stringWithFormat:@"(find-all-facts ((?f state-list)) TRUE)"]; char * evalStr = (char *)evalS; DATA_OBJECT obj;// = {0,-1}; // obj.type = STRING; // obj.value = evalStr; int i = Eval(evalStr, &obj); NSLog(@"%d",i); now when I run this code

Prefered methods for interacting with a rules engine

一曲冷凌霜 提交于 2019-12-05 21:13:09
问题 I am about to dive into a rules oriented project (using ILOGs Rules for .NET - now IBM). And I have read a couple different perspectives regarding how to set up the rules processing and how to interact with the rule engine. The two main thoughts I have seen is to centralize the rule engine (into its own farm of servers) and program against the farm via a web service API (or in ILOG's case via WCF). The other side is to run an instance of the rule engine on each of your app servers and

Rule engines for java application

不羁岁月 提交于 2019-12-05 05:35:54
问题 i want to use some rule engines for my application which is in java. so can you suggest some good rule frameworks? 回答1: JESS Drools "Top 10 Java Business Rule Engines" 回答2: DROOLS is the first one that pops into my mind... There are probably more of those out there, but I would not know as I have next to no experience with 3rd party rule engines... OTOH: Depending on the complexity of your task, you can also roll your own by including any number of scripting languages and providing their

Compile drools guided decision table into rules

点点圈 提交于 2019-12-05 01:32:50
I am wondering how I could use a guided decision table from the Drools Workbench inside a Java application using the drools runtime. The idea is that a user would work defining rules, processes and some decision tables in the workbench, which will be picked up by the drools runtime. Still, for some reason, I can't figure out how to execute this in drools, since it stored the table as a gdst file and it does not seem to compile to drools. With drools, is there a way to: - execute the gdst file as I would with an excel decision table? - or compile a gdst file in rules? I've been looking for a

Drools Rules Template - first invocation 1000 times slower than subsequence invocations

纵然是瞬间 提交于 2019-12-04 21:52:15
I have built a Drools Rules Template using Drools 6.4.0.Final It is pretty much identical to the example provided here . I have wrapped it in a Spring RestController and deployed it as a WAR in to Tomcat . I notice that the first call is always very slow to get a result and gets slower as the number of rows in the xls spreadsheet grows. I imagine drools builds an index when the first ever KieSession is created. And that this index is subsequently cached making further calls much faster? I see the same behaviour when invoking directly from unit tests. First test is slow and subsequent tests are