Re: [rules-users] String length check

2011-11-12 Thread Gabor Szokoli
I can't try in mvel/drools right now, but String has length(), not size. On Sat, Nov 12, 2011 at 1:29 PM, lansyj wrote: > Hi folks, > > I'm trying to create a guided rule which treats customers differently based > on the length of their customer ID. The generated rule source is as follows: > > ru

Re: [rules-users] endless loop even with "no-loop"

2011-03-24 Thread Gabor Szokoli
Maybe your actual business needs have a procedural, flow chart like aspect to them? You can chain ruleflow groups in Drools Flow... If your needs are mostly declarative and you'd like to handle a rare exception with this "fire once" rule, it can be done of course by tweaking the rule a bit: One wa

Re: [rules-users] endless loop even with "no-loop"

2011-03-23 Thread Gabor Szokoli
This is I think something all of us came across while learning Drools... So I searched for "drools loop faq" in google but nothing useful came up. I propose to extend the "inifinite recursion" section in the faq with the best practices for avoiding this! My favorite way to avoid unnecessary activ

Re: [rules-users] how to ensure that one rule only is executed once?

2011-03-18 Thread Gabor Szokoli
Hi, >From what I know, it's generally better to make the rules idempotent: In your case introduce a discountedPrice field, leaving the original price alone. If you insist on making it run only once instead, you can introduce a field or fact class to mark an order "discounted", then all discountin

Re: [rules-users] How to obtain the object/fact created in the rule file?

2011-01-30 Thread Gabor Szokoli
Please excuse my blind bias against globals, but isn't this what Querys are there for? http://downloads.jboss.com/drools/docs/5.1.1.34858.FINAL/drools-expert/html_single/index.html#d0e5362 Gabor ___ rules-users mailing list rules-users@lists.jboss.org

[rules-users] Drools with Hibernate, with dynamic types

2011-01-20 Thread Gabor Szokoli
$m = Map() eval( "PalpusztaiChese".equals($m.get("type")) ) eval((Integer)$m.get("smell") > 11 ) then modify($m) { set("QA","pass"); } end (A DSL could completely hide this difference though, couldn't it?) Tha

Re: [rules-users] Different rule fires when debugging vs running after upgrading to 5.1.1

2011-01-19 Thread Gabor Szokoli
On Wed, Jan 19, 2011 at 6:12 PM, H.C. wrote: > I have been doing some more testing and have observed that the test case > will actually sometimes evaluate to true. Out of 10 runs, 2 succeeded and 8 > failed. I'll elaborate on the "some code to reproduce" part: Try to simplify the test, eliminate

Re: [rules-users] Doubts in Using RulesBase object

2011-01-19 Thread Gabor Szokoli
Hi, Without understanding the intricacies, just on general sw engineering principles: Is the number of possible package combinations too high to cache a rulebase instance for each combination, or at least the ones anybody used recently? If you have n toggle buttons on the GUI to include different

Re: [rules-users] Sudoku example doesn't work in drools 5.1

2011-01-19 Thread Gabor Szokoli
Hi, On Wed, Jan 19, 2011 at 8:35 AM, Mark Proctor wrote: > > Any takers for a more robust sudoku example, that demonstrates best > practice? I'm considering volunteering as a learning exercise. Won't be perfect at first, but you can drill me on those best practices for free :-) However I don't

Re: [rules-users] Does Drools Fusion support "Group By" clause ?

2011-01-04 Thread Gabor Szokoli
Hi, Purely for educational purposes I am trying to figure out how this will work when multiple Sale instances share the same "type" string. It seems to me that under the default "identity" assertion mode of the Working Memory, as many SaleType instances would be maintained as there are unexpired

Re: [rules-users] Does Drools Fusion support "Group By" clause ?

2011-01-03 Thread Gabor Szokoli
Hi, 2011/1/3 Kiran Ananthpur Bacche (kbacche) : > I want the rule to fire successfully only when the TotalSalesAmount for > _any_ given type exceeds 100. I've never used "accumulate" myself, so I looked it up in the manual, and there's an example that's exactly what you want :-) (just substitute

Re: [rules-users] Subject: Drools Planner - Design Suggestions

2011-01-03 Thread Gabor Szokoli
On Sat, Jan 1, 2011 at 1:43 PM, ge0ffrey wrote: > > I agree on the normal constraints with vincent. The 100% sold is like nurses > falling sick. > You cannot plan it in advance. I could be misunderstanding the domain, but I though that's exactly what he wants the most :-) And the historical data

Re: [rules-users] Drools - Repeated Events and Temporal Relations

2010-12-13 Thread Gabor Szokoli
Hi, I'm just learning Drools, so I could be dead wrong, but it sounds like you need "reasoning over the the absence of events" just like advertised here: http://www.jboss.org/drools/drools-fusion.html#Drools_Fusion_Features On Mon, Dec 13, 2010 at 9:20 AM, rodih wrote: > In more details: I want

[rules-users] Flow: "Multiple Instances" vs rule task

2010-12-10 Thread Gabor Szokoli
stance.getVariable("forEachVariable") ) ) ... then Is that the way, or am I missing something here? Thanks in advance: Gabor Szokoli ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users

Re: [rules-users] Multiple bindings with the same type

2010-12-08 Thread Gabor Szokoli
Hi, 2010/12/8 Robert Miyashiro : > Is there some kind of evaluation mode or setting that will make > Drools pay attention to the order in which objects are inserted into the > session? Not that I know of, but here's a way to externally supply the pairs of objects to fire on: rule when $list1

Re: [rules-users] new to Drools: modeling issues

2010-12-06 Thread Gabor Szokoli
suspect what you'd want. Ahh, the dog ate my equals sign: <<< $attribute : StringHolder(get()!="value") $child: Child(parent==$parent ... attribute==$attribute) >>> But the real question here is how I can make Drools treat my attributes as the atomic un

Re: [rules-users] Insert new facts in WorkingMemory event handler

2010-12-06 Thread Gabor Szokoli
I think I've got your use case: you are making XSLT on steroi^W some kind of cheese that tastes stimulating and is dense in nutrients but is in no way controversial. It would allow user rules for removing stuff, and have built-in rules for transitively removing unreferenced stuff, right? On Mon, D

Re: [rules-users] Insert new facts in WorkingMemory event handler

2010-12-06 Thread Gabor Szokoli
om the logical point of view, why do you need to retract unreferenced facts? Do you see performance issues from too many facts? Gabor Szokoli ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users

Re: [rules-users] new to Drools: modeling issues

2010-12-06 Thread Gabor Szokoli
he attention-whoring double take in nomenclature, does that rule pattern look OK? I'll stick with cheese in the future :-) Thanks Again! Gabor Szokoli ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users

[rules-users] new to Drools: modeling issues

2010-12-06 Thread Gabor Szokoli
) $attribute : StringHolder(get()!="value") $child: Child(parent==$parent ... attribute=$attribute) then modify ($attribute) { set("value") } end That looks worse than before! Please share your thoughts. Thanks in advance: Gabor Szokoli __