Drools Eclipse debug views - Audit, Agenda, Working Memory, etc
by devan.vanreenen@gmail.com
Hi there,
Help needed pls.
I have read previous threads from this forum on not being able to see any
content on Drools Eclipse debug views - Audit, Agenda, Working Memory, etc
when debugging rules and still cant seem to get this working
I have tried the following suggestions
I inspect my stateless session under variables tab on eclipse debug
perpective and there is no member variable for the Working Memory to select.
I have tried suggestions around refresh issues as well.
Is there anything else I can check or do?
Thanks
Devan
--
View this message in context: http://drools.46999.n3.nabble.com/Drools-Eclipse-debug-views-Audit-Agenda...
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years, 3 months
Fusion: Insert passed events
by javadude
Hi !
scenario: Event A then Event B. If there is no Event B after 5 min of A then
trigger rule.
*when
time1:(Event) from entry-point xxx
not (Event(this after[ 0,5m ] time1)) from entry-point xxx
then
...
end*
For realtime event that works fine, but in real life you have the event
coming in delayed, eg. from an interface.
Example:
Event A time: 01:00 (mm:ss) but received at 02:00
Above rule will trigger at 07:00, but the business logic would require it to
be triggered at 06:00
How do I handle this kind of requirement ?
Thanks
Sven
--
View this message in context: http://drools.46999.n3.nabble.com/Fusion-Insert-passed-events-tp3824630p3...
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years, 3 months
Future events
by lexsoto
Hello:
I have this rule:
An event is inserted that has a timestamp in the future, the rule is fired.
This looks like a bug, because the sliding time window has not yet met the
timestamp of the event.
I expect the rule to fire not immediately but only when the time reaches the
event time.
Is my assumption/understanding correct?
--
View this message in context: http://drools.46999.n3.nabble.com/Future-events-tp3826236p3826236.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years, 3 months
[rule-users]Drools Fact Management with Large Dataset in RDBMS
by CW
Thank you in advance for your time reading this post first.
I have to make my rules work with databases with TB of data, so fact
management become a major issue when I design my system. Currently I have
several main programs which use both stateful and stateless sessions. I
would like to collect some good practices to manage the insertion and
disposal of facts so that I can keep my working memory healthy. Below are
some of my findings in this forum:
1. Insert only relevant facts into working memory with the use of "data
preparation" rule together with Drools pipeline (hibernate, mybatis, etc).
An excellent example from manstis in the post
http://drools.46999.n3.nabble.com/Applying-rules-on-the-data-in-an-RDBMS-...
---------------------
rule "bootstrap"
salience -100
when
$list : List( ) from placeHolder.namedQuery("Smurfs")
then
for(ExternalObject o : $list ) {
insert( o );
}
end
--------------------
2. Use "insertlogical" instead of "insert" when inserting facts in rule
3. Implement "garbage collection" rule to clean up unwanted facts
I would like to ask:
1. if there are any other suggestion on optimizing fact management?
2. is there a way for the rule engine to directly operate on data in
database (perhaps with some other plugin?)
Thanks again!
--
View this message in context: http://drools.46999.n3.nabble.com/rule-users-Drools-Fact-Management-with-...
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years, 3 months
Nesting prefix-or and prefix-and causing parsing problem
by Patrik Dufresne
Hi,
I have a problem with nesting prefix-and and prefix-or. I found a bug in
JIRA but it been fixed in drools expert 5.0. Here is snippet to reproduce
the problem (based on the original rule). I get the following error :
java.lang.RuntimeException: [48,5]: [ERR 102] Line 48:5 mismatched input
'EmployeePreferredShift' in rule "assign-preferred-position"
declare EntityA
number : int
end
declare EntityB
number : int
end
declare EntityC
number : int
end
rule "and-or-snippet"
dialect "java"
when
EntityA(
$number : number)
not ( and
EntityB (
number == $number )
( or
( and
EntityC (
number < $number)
not EntityB (
number == 4)
)
not EntityC (
number == 10 )
)
EntityA (
number <= $number )
( or
not EntityC (
number >= $number)
( and
EntityC (
number == 4 || number >=10 )
not EntityB (
number == -3)
not EntityB (
number == -10 )
)
)
not EntityB(
number == 0)
)
then
System.out.println("Working");
end
Patrik Dufresne
14 years, 3 months
Drools and Jersey
by mike
Hi there,
I am trying to make rest calls from Drools. For that I am using Jersey
http://jersey.java.net/. I cannot no get it to work if I use mvel,
otherwise it works fine.
Here is a sample rule:
----------------------------------------------------------
import com.sun.jersey.api.client.Client;
dialect "mvel"
rule "create Rest Client"
then new Client();
end
----------------------------------------------------------
I would love to be able to use mvel since it curves java syntax :)
Thank you
Mike
14 years, 3 months
drools arithmetics without eval()
by fx242
I have a question regarding eval() use. My rulebase is around ~3k rules, most
of them are auto-generated by templates, and they end up looking like this:
rule "CONFIG_114"
salience 0
when
client: Client()
contextProd: PortfolioProduct(prodAdded == true, productId ==
"PROFESSIONAL")
Number(qty_00001: intValue) from accumulate(pp:
PortfolioProduct(productId in ("BOX_001"), prodAdded == true), count(pp))
Number(qty_00002: intValue) from accumulate(pp:
PortfolioProduct(productId in ("BOX_002"), prodAdded == true), count(pp))
Number(qty_00003: intValue) from accumulate(pp:
PortfolioProduct(productId in ("BOX_003"), prodAdded == true), count(pp))
Number(qty_00004: intValue) from accumulate(pp:
PortfolioProduct(productId in ("BOX_004"), prodAdded == true), count(pp))
Number(qty_00005: intValue) from accumulate(pp:
PortfolioProduct(productId in ("BOX_005"), prodAdded == true), count(pp))
eval(qty_00001 == 1)
not(eval(qty_00002 >= (qty_00003 + qty_00004 + qty_00005)))
then
balance(kcontext, contextProd, qty_00002, ">=", (qty_00003 + qty_00004 +
qty_00005));
end
These rules have all one or two evals in the end, comparing product
quantities that are present in the Working Memory.
My question is: Is there any better way to write this kind of rules without
resorting to eval()?
I'm currently getting hit (in performance terms) by over-using these, so I
wonder if there is a better way to do this.
Thanks!
Tiago Lopes
--
View this message in context: http://drools.46999.n3.nabble.com/drools-arithmetics-without-eval-tp38232...
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years, 3 months