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

[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

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] 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

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:

[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

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

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 ) from

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

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

[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

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:

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

[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

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

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] 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

[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

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

[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] 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:

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] 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

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
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

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

2011-01-29 Thread groovenarula
/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 file. But I'm stuck at one point

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

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

2011-01-26 Thread groovenarula
. Look for a section 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 outlining the approach, Edson

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. I found it. I

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.

[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

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

2009-12-03 Thread groovenarula
); Rule Name Number Directors Warning example1 Hotbuys Hotbuys missing Hope that helps, Thomas From: rules-users-boun...@lists.jboss.org [mailto:rules-users-boun...@lists.jboss.org] On Behalf Of groovenarula Sent: 03 December 2009 06:51 To: rules-users@lists.jboss.org

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

2009-12-03 Thread groovenarula
...@lists.jboss.org [mailto:rules-users-boun...@lists.jboss.org] On Behalf Of groovenarula Sent: 03 December 2009 06:51 To: rules-users@lists.jboss.org Subject: [rules-users] Can we use 'from' CE in Decision Tables ? Hello all, Is it possible to define the follow rule in a decision table : rule Activate

[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 what I