Please someone help me on this.
techy wrote:
>
> I would like to collect All Foo() for which there is no Bar() as given
> below.Please help me on this.
> Thanks.
>
> //psedo rule
> rule 'test'
> list : from collect( Foo(fooId: id) and not Bar(id !=
I would like to collect All Foo() for which there is no Bar() as given
below.Please help me on this.
Thanks.
//psedo rule
rule 'test'
list : from collect( Foo(fooId: id) and not Bar(id !=fooId))
then
//do conseq
end
--
View this message in context:
http://www.nabble.com/Collect-from-tp25014904
You are right Edson.
I also have another rule with less salience value that does < comparison. my
attention was completely on first rule which does null check and thinking
that was causing the issue :(. Good find and thanks again for the help.
Edson Tirelli-3 wrote:
>
> Techy,
&
Hello,
For following rule, NullPointerException is thrown for null id in 4.x. is
this expected? Please clarify.
Foo{
Integer id;
}
Rule "null check"
foo : Foo(id==null)
then
end
stack trace:
java.lang.NullPointerException
at
org.drools.base.extractors.BaseObjectClassFieldExtractor.getIn
Hello
Simplified version of my rule is given below. Since I want to run this rule
once once, I control it using Bar() fact.
This rule fired inconsistently(i.e sometime it fired, sometime it is not). I
could not also reproduce. Does anybody have the clue for this? Thanks for
the help.
rule "run o
Thanks Arjun.
"you may be using the same object in all your rules; so the theoretical
ReteOO performance goes for a toss coz it does branch the tree based on
object type." it is interesting to know this point. I didn't know that also
affects performance.
Yes. I use same object in most of the rules
Hello,
Please guide me to implement following rule.
I would like to found out the city where absence of either Male or Female
found for same age. I also need to have ref to those Men and Female of that
city in collection to use it RHS. Also there will be max of one male &
female for same age.
Mal
> Solaris does a real nice job of managing system resources. I've freaked
> out
> our operations guys by running systems at 100% more than once. ;-) I had
> the boxes doing a lot of work, but not thrashing the CPU.
>
> Learn to use vmstat and monitor the run queue. Gene
d "~60 rules" is to be
>> expected
>> as all the work is being done during fact insertion. Of course, adding
>> more and
>> more rules will, eventually, push the CPU load factor to the natural
>> upper limit.
>>
>> If the overall throughput is g
for batch of execution(i.e 1000 facts), I create stateless session in
consumer and execute as given below.
this.ruleBase.newStatelessSession().execute(facts);
techy wrote:
>
> Hello
> My app is functioning consumer/producer model.
> 1.Producer reads the data from DB and inserts
Hello
My app is functioning consumer/producer model.
1.Producer reads the data from DB and inserts to blocking queue
2.Consumer reads the data from queue and execute the rules using drools
stateless session.
Both producer and consumer run asynchronously.
in my testing I found the following
1. f
Hello,
My retract util func() is below and ClassCast exception is thrown. Some help
please...
public static void remove(WorkingMemory workingMemory,T... array)
{
if(array == null || array.length == 0)
{
return;
}
for (int i=0;ihttp://www.
Hello,
If I have declared the same global var(ex:global Logger logger) in two drls
and then add those into package builder & rulebase,
how does drools handle them? will first declaration be overridden by first?
Please clarify.
--
View this message in context:
http://www.nabble.com/Same-global
Hello,
I would like to have all drools utility function in one drl file(static drl
like static util class) and would like to refer to them all there drl
without getting eclipse compilation error.
Is it possible?
Thanks for the help.
--
View this message in context:
http://www.nabble.com/util-d
Hello,
I'm checking for condition ' field not matches ".*ABC.*" ` in my rule.
when field value is null, rule does not fire. But if field value != null and
!= ABC, then rule fires.
Is this expected output or bug? Please clarify.
Thanks
--
View this message in context:
http://www.nabble.com/%22
> then
> //do conseq
> end
>
> You can replace your timestamp (100) above with a Date variable or
> something like it.
>
> []s
> Edson
>
> 2009/2/17 techy
>
>>
>> I think I better more accurate info for my requirement.
>>
&
ker( price == 20.00 && timeInMillsec is close
to 100 ))
then
//do conseq
end
Thanks.
techy wrote:
>
> That's makes Edson. Thank you.
>
> Is there way to to sort the facts collected using "collect" in LHS itself?
> I could not find any hint in the
nt all of them, use "collect" instead of "exists".
>
>[]s
>Edson
>
> 2009/2/17 techy
>
>>
>> I get $foo can't be resolved error for following rule. Some guidance is
>> appreciated to reference $foo without error.
>>
>&
emory.*insert*(array[i]);
>> }
>> *return*;
>> }
>>
>> ...
>>
>> *rule* "StarCoApplicants" *ruleflow-group* "STAR"
>> *dialect* "mvel"
>> *when*
>> $creditContract : Cred
I get $foo can't be resolved error for following rule. Some guidance is
appreciated to reference $foo without error.
Rule "Foo rule"
when
exists( $foo: Foo())
then
System.out.println($foo);
end
Thanks in advance.
--
View this message in context:
http://www.nabble.com/error-when-referening
uleflow-group "STAR"
> dialect "mvel"
> when
> $creditContract : CreditContract ()
> then
> insertArray(drools.workingMemory,$creditContract.coApplicantArray);
> end
>
>
> Kent Symanzik
>
>
>
>
> techy
> Sent by: rules
I would appreciate If someone can clarify this.
Thanks in advance
techy wrote:
>
> Hello,
>
> Is there way to insert all facts from collection (similar to
> session.execute(collection)) in the rule consequence ?
>
> Thanks!
>
--
View this message in context
Hello,
Is there way to insert all facts from collection (similar to
session.execute(collection)) in the rule consequence ?
Thanks!
--
View this message in context:
http://www.nabble.com/Inserting-collection-of-facts-in-rule-Consequence-tp21814308p21814308.html
Sent from the drools - user mail
> rule "unlucky male"
> where
> $c : City()
> $m : Male( $age : age ) from $c.maleList
> not( Female( age ==$age ) from $c.femaleList )
> then
> // $m is unlucky, no female with the same age
> end
>
>[]s
>Edson
>
>
>
Hello,
Please help me to implement following rule in drool. I could not find a way
to iterate two collection using accumulate or collect in LHS.
public Male{
int age;
//other fields
}
public Female{
int age;
//other fields
}
public City{
private List maleList;
private List femaleL
NVAL
> DEFAULT_NODE
> DEFAULT_PROP
> DEFAULT_REFS
>
>
> REP_FSENTRY
> REP_VERSION_FSENTRY
>
>
> VERSION_BINVAL
> VERSION_NODE
> VERSION_PROP
> VERSION_REFS
>
>
> Please help.
>
> Regards,
> Ashish
>
> On Fri, Jan 23, 2009 at 10:26 AM
I do it this way...hope this may help..
List rules = dao.getAllRules();//reads RULE table and returns list of
rule Object
for (Rule rule : rules)
{
try
{
Clob ruleClob = rule.getRuleContent(); //I store
complete rule info
Please ignore. I found the problem.
techy wrote:
>
> I'm getting following exception when tried to insert an object(which has a
> Long field and three List reference) retrieved from dao in rule
> conseqence. From stackTrace, I can see that it is thrown when drools is
>
I'm getting following exception when tried to insert an object(which has a
Long field and three List reference) retrieved from dao in rule conseqence.
>From stackTrace, I can see that it is thrown when drools is trying to create
an instance of List(which is not possible).
Please someone clarify t
is there a way to do sql 'like' comparison in LHS without using eval+custom
drool function?
pseudo code:
when Foo( name like "Mrs")
Thanks
--
View this message in context:
http://www.nabble.com/String-%27like%27-comparison-in-mvel-tp20982921p20982921.html
Sent from the drools - user mailing l
I would like to do lhs ""contains"" check on global list for fact field as
given below. but no luck so far.. some help please.
global List globalIdList
#psedo rule
rule "check global lsit"
when
foo: Foo()
list : List() from globalIdList
list contains foo.getId()
#also tr
"+event.getEventId());
counter.setCount(counter.getCount()-1);
update(counter);
end
dave sinclair wrote:
>
> Make counter an object
>
> when
> $counter : Counter(value <= 100)
> ...
>
>
> On Mon, Dec 8, 2008 at 5:05 PM, techy <[EMAIL PROT
Hi,
Is there way to assert more than one collection into stateless session?
StatelessSession has single colletion input function : execute(Collection
collection) function.
Please clarify.
Thanks
--
View this message in context:
http://www.nabble.com/asserting-more-than-one-collection-into-sta
Hello,
I would like to take 100 sampling facts for rule and persist it in the db
and ignore other data.
How Can I maintain the counter? as global variable? Please clarify with
sample code.
I tried following way and but it does not work as expected.
Ex:
global Integer counter;
rule "get sampling d
Hello Mark,
Is this a bug?
techy wrote:
>
> I use 4.0.7.
>
>
> Mark Proctor wrote:
>>
>> techy wrote:
>>> I have rule that logical comparison with two Float fields(like price <
>>> bidPrice || price >= bidPrice ). I get following exceptio
of use
> http://blog.athico.com/2007/06/chained-from-accumulate-collect.html
>
>
> On Wed, Nov 26, 2008 at 9:08 PM, techy <[EMAIL PROTECTED]> wrote:
>
>>
>> though I referred other thread about this topic, I'm not successful to
>> make
>> a
>>
I use 4.0.7.
Mark Proctor wrote:
>
> techy wrote:
>> I have rule that logical comparison with two Float fields(like price <
>> bidPrice || price >= bidPrice ). I get following exception if one of
>> field
>> is null. Is this expected behaviour? Please cla
I have rule that logical comparison with two Float fields(like price <
bidPrice || price >= bidPrice ). I get following exception if one of field
is null. Is this expected behaviour? Please clarify. Thanks
Caused by: java.lang.NullPointerException
at
org.drools.base.extractors.BaseObject
though I referred other thread about this topic, I'm not successful to make a
dao call.
I beg your pardon to ask again.
1. I want to pass the fact object to the dao function which returns boolean.
I tried following rule and getting "
Unexpected token '$fact'" as eclipse compilation error. Please
Hello,
1.Is there any situation where one compiler can be preferred over other?
2. which compiler is ideal choice for production environment?
Please clarify.
Thanks
--
View this message in context:
http://www.nabble.com/Pros-n-Cons-of-JANINO---ECLIPSE-JDT-tp20630943p20630943.html
Sent from the
I take back.. I noticed that it happened while I was doing memory profiling.
for normal execution, it works fine..
Is there any limit on # of facts to be inserted into stateless session? or
does it depend only on heap size?
thanks.
techy wrote:
>
> If I have set of rules(say 5 rules f
If I have set of rules(say 5 rules for now.. which just compares few fields
in facts and increments execution count on Rule Object as a consequence)
working on single fact and I have huge amount of data to process,
How many maximum facts can I insert into stateless session at a time for
faster exe
Hello,
>From the below example, Do I need to make function
"incrementExecutionCount()" threadSafe here or does drools make threadSafe
call to external functions? Please someone clarify. Thanks.
global SampleDao dao;
rule "1"
when "some condition on fact"
then
Rule r = dao.getRule("1");
e not contains "1 precondition", f1 !=
> null, f2 != null)
> then
> foo.addPreconditionPassedRule("1 precondition");
> update(foo)
> end
>
> As for lock-on-active, it should be used in conjunction with a
> ruleflow-group or agenda-group. It's
didnt include
rule "1 main condition" consequence before... updated rules & facts are
given below
techy wrote:
>
>
> I tried following rules as given below and result are:(assumes facts
> which I tried are qualified for both rules)
>
> 1. when lock-on-activ
I tried following rules as given below and result are:(assumes facts which
I tried are qualified for both rules)
1. when lock-on-active used with both rule, only rule "1 precondition" got
executed for all facts.
2. when no-loop used with both rules, infinite loop
3. when lock-on-active for rule
ion of the
rules with less salience by rules with higher salience in Sequential Mode.
Actually I want to control rules execution this way. Is there any hack to
achieve this now?
Thanks again!
Greg Barton wrote:
>
>
> --- On Fri, 11/7/08, techy <[EMAIL PROTECTED]> wrote:
>
&g
JVM GC
take care of the clean up as long as I don't maintain any ref to those facts
in my application?
Greg Barton wrote:
>
> --- On Fri, 11/7/08, techy <[EMAIL PROTECTED]> wrote:
>
>> 1. I can't have multiple session from same rulebase and
>> assign each ses
hem. (i.e. mostly single object conditions, and less multi-object
> conditions.)
>
> --- On Thu, 11/6/08, techy <[EMAIL PROTECTED]> wrote:
>
>> From: techy <[EMAIL PROTECTED]>
>> Subject: [rules-users] Rule processing for High volume input
>> To: rules-users@
Hello,
searched the forum already for this question and didn't get clear answer.
I would like to insert collection of facts into session(instead of looping
over each fact inserting) and assert the rules on each fact as usual.please
share your knowledge.
--
View this message in context:
http://
If I have r1,r2,r3, execution flow has to be
1. fire r1 first
2.then fire r2 if r1 was fired
3.then fire r3 if r1 got executed & r2 was not fired
then i can think of following way using salience and control flag.
rule r1
salience 10
when r1 condition
then
fact.r1Executed = tr
I have to run rules(1000 rules) against 20-30 million of record each day.
I guess I would have memory issue If I insert all of records into working
memory.
so I'm thinking to have multiple rule base instance and do batch processing
as given below.so that I can avoid memory issue and quick rule pr
Kris,
Please clarify me.
If anyone else has implemented db driven ruleflow, Please share your ideas.
Thanks
Kamesh
Edson Tirelli-3 wrote:
>
>I guess you need to talk to Kris, the ruleflow master. :)
>
> 2008/11/6 techy <[EMAIL PROTECTED]>
>
>>
>> T
s
> as
> the rule base grows, because more rules you have, more you will benefit of
> optimizations like node sharing and other techniques.
>
>If you go ahead, I suggest you contact Red Hat. They can help with your
> solution design, training (if necessary) as well as provide
Hello,
I have similar doubt. Please clarify.
I have r1,r2 in rfg1 and r3,r4 in rfg2.
1. execute rg2 after rg1. this can be in rule flow. no issue.
2.I want to execute r2 for facts where r1 is true. how can I do this without
using semaphore fact or r1 conditions in r2 LHS in rule flow?
3.I want t
Thanks Edson.
Few more questions based on my requirements.
I want to load all rules from the database once for everyday(during daily
job startup) and apply them against huge amount of data.here rules are once
loaded, no further need for dynamic addition/removal during that execution.
But If I ad
e I'm new to drools. It would be
great If someone shed some light on this?
1. Can I achieve this work flow using rule flow?
2. What about sequential mode? Can I achieve using it?
3. Should I not be using drools or any rule engine at all for my
requirement?
Thanks
techy wrote:
>
&g
than the custom agenda filter approach, but:
>>
>> 1) I haven't tested the custom agenda filter thing, so I'm just guessing
>> it'd work. (I'm pretty sure it would, though.)
>> 2) It would be more portable across other rule engines. (If that's
>>
Hello,
I have some drools beginner questions
1.what is default dialect if it is not specified?
2. can We mix java and mvel syntax in LHS?
Ex:
class Cheese(String type,Set ingredients)
Is this valid LHS?
when cheese : Cheese(ingredients.getIngredients().size > 3,type ==
"American")
3. In my samp
Hi,
If the rules,conditions,consequences have to be loaded from the database. I
can think of following two approach. what would be right approach( I will
have upto 1200 rules in the db)
1. Programmatically inject the rules into rule engine using drools API.
2. Read the rules from the database a
, won't it affect other parent rule node?
Greg Barton wrote:
>
> You may consider the other suggestion of retracting the fact(s) that would
> trigger the child rule. It's the more "natural" way of going about it.
>
> What's driving this design choice?
s initially prevented from firing, can it be
> reactivated? If so, when and under what conditions?
>
> --- On Thu, 10/30/08, techy <[EMAIL PROTECTED]> wrote:
>
>> From: techy <[EMAIL PROTECTED]>
>> Subject: [rules-users] controling rule execution
>> To: rules-
Hello,
I would like to have the rules parent/child structure. I don't want the
child rules to be executed when parent's conditions are true(i.e
consequence is executed) even if child's conditions are true. How Can I
achieve that in drools?
Please clarify.
--
View this message in context:
htt
63 matches
Mail list logo