Re: [rules-users] drools grid or other high availability solution?

2012-11-12 Thread groovenarula
Follow up on high availability - I'm planning to use Drools for Capacity Management. In my use-case I need to track # of hours of planned capacity that has been consumed based on hours allocated. I'm planning on having a StatefulKnowledgeSession that will have facts that store the # of hours of c

Re: [rules-users] ConcurrentModificationException loading facts from db (Hibernate).

2012-07-03 Thread groovenarula
That worked. Thanks for clearing this up. -- View this message in context: http://drools.46999.n3.nabble.com/ConcurrentModificationException-loading-facts-from-db-Hibernate-tp4018431p4018437.html Sent from the Drools: User forum mailing list archive at Nabble.com.

[rules-users] ConcurrentModificationException loading facts from db (Hibernate).

2012-07-03 Thread groovenarula
In my use case, I have ~ 200,000 rows in a table that I need lookup in order to price an item. Rather than load the entire table into working memory,I'm trying load the relevant rows (based on a matching criteria) and load those as facts and then have my rules evaluate the loaded facts. Based on th

[rules-users] NullPointerException using 'enabled' function.

2012-07-01 Thread groovenarula
I'm trying to use the enabled function to ensure that some rules only fire under certain conditions. I have the following in my DRL : rule "Load pricelist" salience 1 when $unitPrice : Pricelist() from PricelistUtilities.getPriceLists() then

[rules-users] Is it safe to 'build' a knowledgebase (compile rules) in a web app?

2012-04-18 Thread groovenarula
Hello, In our environment we need to develop a framework wherein we would have about a dozen rule templates whose data will be provided by users using spreadsheets. Basically users will upload excel workbooks containing 10-12 worksheets and we'll be using ExternalSpreadsheetCompiler to generate th

[rules-users] Runtime Java Exception - Firing rules (Drools Expert 5.2.1).

2012-04-12 Thread groovenarula
Hello all, We're getting the following exception executing our rules in Drools 5.2.1 : WARN: Execution of JMS message listener failed java.lang.NoClassDefFoundError: org/drools/factmodel/traits/Thing at org.drools.compiler.PackageBuilder.initBuiltinTypeDeclarations(PackageBuilder.java:33

Re: [rules-users] Drools parser error accessing ArrayList.

2012-04-12 Thread groovenarula
That worked. Thanks. Also in the course of running into this, i did manage to find a better way to do it. I move the for loop into the LHS and that worked too. I think I'll go with the latter - I think it's a better way anyway... -- View this message in context: http://drools.46999.n3.nabble.com/

Re: [rules-users] Drools parser error accessing ArrayList.

2012-04-11 Thread groovenarula
laune, Unfortunately, the earlier test worked when I set the dialect to "java". It does not work when it's set to "mvel". When the rule is written as follows : rule "Hello World" dialect "mvel" when $cur: Message() $others : ArrayList ( size > 0 ) fro

Re: [rules-users] Drools parser error accessing ArrayList.

2012-04-11 Thread groovenarula
Thanks W, It worked after I moved opening brace to the same line as the 'for'. But 'wow - we've spent several hours trying to resolve this on our own. And we did not want to post before we confirmed that we've taking care of all the obvious.. But seriously - someone is advocating that MVEL use

[rules-users] Drools parser error accessing ArrayList.

2012-04-11 Thread groovenarula
Hi, I have a situation where I need to iterate over an ArrayList in the RHS of a rule. The ArrayList is created in the LHS of the rule as follows : rule "Hello World" dialect "mvel" when $cur: Message() $others : ArrayList ( size > 0 ) from collect(Mess

Re: [rules-users] Rule does not fire after 'Modify/Update' of a fact - Drools 5.1.1 !

2011-04-05 Thread groovenarula
oh - ok - My bad then - I need to read up more on how to write proper hashing algorithm - for what ever reason, I thought that == use object reference when comparing objects ! I guess that's not the case and that it's using the object's hash code to compare objects. Thanks for pointing this issue

Re: [rules-users] Rule does not fire after 'Modify/Update' of a fact - Drools 5.1.1 !

2011-04-05 Thread groovenarula
Just ran another test, I removed the check for 'price == null' in the 'Set Options Price' rule - so the rules now reads : rule "Set Options price" salience 50 when $prod : Product ( ) $option : Option ( product == $prod ) then

Re: [rules-users] Rule does not fire after 'Modify/Update' of a fact - Drools 5.1.1 !

2011-04-05 Thread groovenarula
Thanks for the response Wolfgang. I am not calling ksession.fireAllRules(1). I just have ksession.fireAllRules(); I tried inserting 2 pairs - One product with a price set and the other left as null. The one with the null still does not fire the 'Set Options Price' after it's price has been set by

[rules-users] Rule does not fire after 'Modify/Update' of a fact - Drools 5.1.1 !

2011-04-04 Thread groovenarula
Hello all, For some reason I have a rule that does not fire after a Modify/Update. I have 2 facts - Product and Option. The relationship between them is that a 'Product' can have 0 - N 'Option'(s). Based on that, I added a 'product' field to the 'Option' object. I'm creating and inserting my fac

Re: [rules-users] is is possible to insert facts into working memory from functions ?

2011-03-11 Thread groovenarula
Duh !!! Of course - I forgot the import statement. For some reason I thought KnowledgeHelper would already be imported. Thanks for your help once again W ! -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/is-is-possible-to-insert-facts-into-working-memory-

[rules-users] is is possible to insert facts into working memory from functions ?

2011-03-10 Thread groovenarula
Hello all, As the title states, I need to create new facts and insert them into working memory from a function. Is it possible to do that ? I tried to create a function with 'KnowledgeHelper' as a parameter and my rule file failed to compile. Then I even tried to reference 'drools' instance variab

Re: [rules-users] Is it possible to Iteriate over a list of string values ?

2011-03-10 Thread groovenarula
ok ! It looks like Wolf, your idea of using 'for' in the RHS worked using rule templates. It's still 'java' code though. I just wish there was a cleaner way to load facts into WM without going through java. Declaring types in rules is a very nice feature. If there's a cleaner way to 'load' these

Re: [rules-users] Is it possible to Iteriate over a list of string values ?

2011-03-09 Thread groovenarula
I was hoping to be able to give the Business Analysts an overall process to use Drools by avoiding as much java code as possible. If there was some way to do this, I could have just had them create different templates they would need (based on the format of the spreadsheets they currently use) and

Re: [rules-users] Is it possible to Iteriate over a list of string values ?

2011-03-09 Thread groovenarula
All, Thanks for the quick responses. Mantis, I did try using from [ "one","two","three" ] syntax, but it did not work. It gave me a parser error. Basically I need to create a spreadsheet reader that inserts values into WM before reasoning over them. The spreadsheet that the users are currently

[rules-users] Is it possible to Iteriate over a list of string values ?

2011-03-08 Thread groovenarula
Hello all, In one of my use cases, I need to insert a variable collections of facts into working memory in order to be able to test for those values later : So I was wondering if there's a way to do something like this when $vals : String() from [ "A 12345", "B 45678", "C 8695" ]

Re: [rules-users] How to validate literal values on the LHS of rules.

2011-03-07 Thread groovenarula
Ok - I managed to get this to work. Now the main question - I've used ExternalSpreadsheetCompiler. This is still considered 'Experimental' per the 5.1.1 documentation ! And when I look at some history it looks like RuleTemplates have been around since August of 2008. Is there a road map of when Rul

Re: [rules-users] How to validate literal values on the LHS of rules.

2011-03-06 Thread groovenarula
Thanks for advise W - I like your idea : 'you could insert them as facts and run simple generic rules to contrast them to another set of facts taken from the data base'. So if I understand you right - I should be able to create a template that declares a type and then using a template I should b

Re: [rules-users] How to validate literal values on the LHS of rules.

2011-03-05 Thread groovenarula
Manstis, You are correct. There are parameters that users will provide in the spreadsheet that I need to validate. Actually there will be one spreadsheet. It's going to serve 2 purposes. Provide a decision table AND also be a container of data for a few Rule Templates. The concept is that if a pro

[rules-users] How to validate literal values on the LHS of rules.

2011-03-05 Thread groovenarula
Hello all, In my use case, I am planning on using decision tables to implement rules that contain product information (product attributes - like product grade, product style etc). I've managed to put together the spreadsheet and have been successful in generating different set of rules (using rule

Re: [rules-users] Getting different results from decision tables based on number of facts - all other fact information staying the same.

2011-02-10 Thread groovenarula
Thanks for the pointer Wolfgang. I'll change the DRL accordingly. -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Getting-different-results-from-decision-tables-based-on-number-of-facts-all-other-fact-information-s-tp2467364p2468740.html Sent from the Drools

Re: [rules-users] Getting different results from decision tables based on number of facts - all other fact information staying the same.

2011-02-10 Thread groovenarula
Never mind. I figured it out. I had not merged the fact cell over the 2 columns that had the unit constraint. I'm good. Thanks for looking though. -- View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Getting-different-results-from-decision-tables-based-on-number-o

[rules-users] Getting different results from decision tables based on number of facts - all other fact information staying the same.

2011-02-10 Thread groovenarula
Background : I have an object model is as follows : Units 1 ---> 0..N Options where a unit (basically an item in stock), can have 0 … N Options. Items themselves have 2 primary fields - an item type (called group - a 3 digit number that represents the category the item

Re: [rules-users] How to write a rule that fires when it matches against specific facts in working memory.

2011-02-09 Thread groovenarula
Wolfgang - adding the dialect to the 'Functions' cell worked like a charm. Edson's solution did not work without the dialect mvel. So in this case MVEL is a must have. But then your suggestion to add the dialect next to the cell keyed Functions worked. Thanks again for your help. -- View this m

Re: [rules-users] How to write a rule that fires when it matches against specific facts in working memory.

2011-02-05 Thread groovenarula
Edson/Wolfgang, Thanks to your suggestions, I've got this working the way I need it using rules defined in a .drl file. I think I have just one hurdle left before I start working out how to get it working through decision tables - and that is how to specific 'mvel' dialect for decision tables.

Re: [rules-users] How to write a rule that fires when it matches against specific facts in working memory.

2011-01-29 Thread groovenarula
2011/1/29 groovenarula <[hidden email]> Edson, I did manage to use the 'CollectSetAccumulateFunction' as a template for the MatchAll and have also successfully 'called' the accumulate function from a rule written in a .drl f

Re: [rules-users] How to write a rule that fires when it matches against specific facts in working memory.

2011-01-29 Thread groovenarula
Edson, I did manage to use the 'CollectSetAccumulateFunction' as a template for the MatchAll and have also successfully 'called' the accumulate function from a rule written in a .drl file. But I'm stuck at one point - how to send the value of $param to the accumulate method ? From what I understa

Re: [rules-users] How to write a rule that fires when it matches against specific facts in working memory.

2011-01-26 Thread groovenarula
/org/drools/base/accumulators/CollectSetAccumulateFunction.java <https://github.com/droolsjbpm/droolsjbpm/blob/master/drools-core/src/main/java/org/drools/base/accumulators/CollectSetAccumulateFunction.java> Â Â Edson 2011/1/26 groovenarula <[hidden email]> Thanks Wolfgang

Re: [rules-users] How to write a rule that fires when it matches against specific facts in working memory.

2011-01-26 Thread groovenarula
on titled "Accumulate Functions". > > You could also use accumulate with all the steps in inline code, which is > documented in the preceding section. > > -W > > > > On 26 January 2011 16:50, groovenarula <[hidden email]> wrote: > > Thanks for

Re: [rules-users] How to write a rule that fires when it matches against specific facts in working memory.

2011-01-26 Thread groovenarula
Thanks for outlining the approach, Edson. Unfortunately, I'm a newbie using drools, so I just need some clarification on what you mean by 'matchAll is your own accumulate function with the semantics you described.' ? Do you mean that I have to create a 'custom' accumulate function ? Edson, if t

Re: [rules-users] How to write a rule that fires when it matches against specific facts in working memory.

2011-01-21 Thread groovenarula
Thanks for the options, Bruno and Wolfgang. But is there a more 'generic' way to do the matches ? The problem I have is that the # of instances that might match could vary. And I have to provide a means for the business users to be able to provide that 'option's code' using a decision table. Bas

[rules-users] How to write a rule that fires when it matches against specific facts in working memory.

2011-01-20 Thread groovenarula
Hello, I have a fact called 'Option' : public class Option { private String code; private Item item; public String getCode() { return code; } public void setCode(String optionCode) { this.code = optionCode; } At an

Re: [rules-users] Can we use 'from' CE in Decision Tables ?

2009-12-03 Thread groovenarula
> > NAME > > CONDITION > > ACTION > > > > l :Line > > > > > > eval(!l.getPromos().contains(new Promotion("$param"))) > > System.out.println("$param"); > > Rule Name > > Number Directors > > Warning >

Re: [rules-users] Can we use 'from' CE in Decision Tables ?

2009-12-03 Thread groovenarula
; > eval(!l.getPromos().contains(new Promotion("$param"))) > > System.out.println("$param"); > > Rule Name > > Number Directors > > Warning > > example1 > > Hotbuys > > Hotbuys missing > > > Hope that helps, > > Thomas > &g

[rules-users] Can we use 'from' CE in Decision Tables ?

2009-12-02 Thread groovenarula
Hello all, Is it possible to define the follow rule in a decision table : rule "Activate Promotion" when l : Line( ) not ( Promotion ( code == "HOTBUY" ) from l.promos ) then #do some action end The rule above works perfectly for wha