Re: [rules-users] Working memory view is empty
by Marina
I figured what was wrong - I did not convert my project into Drools project and the debug profile was not starting it as a Drools application. Once I did that - I could see the objects in all views.
Marina
----- Original Message ----
From: Marina <ppine7(a)yahoo.com>
To: Rules Users List <rules-users(a)lists.jboss.org>
Sent: Friday, June 20, 2008 9:07:14 AM
Subject: [rules-users] Working memory view is empty
Hi,
It might be something very simple, but I can't see it. I use Eclipse 3.3 with JBoss Rules 4.0.7 plugin.
I'm trying to debug my rules , but no matter what breakpoints I set I can never get anything in the Working Memory or Agenda views.
I tried setting a normal Java breakpoint on the session.fireAllRules() method -- it stops before calling the method, I select the session variable in the Debug Variables view - but nothing is displayed in the Working Memory view. I even tried to step into the fireAllRules() method - but the Working Memory view is empty at all times.
Then I tried to set a rules breakpoint in a "then" part of my rule - this time Eclipse does not even stop there, instead, it stops on the statement after the call to the fireAllRules() method.
Do I have something mis-configured??
thanks,
Marina
16 years, 5 months
OR in more than one level
by Sergio Stateri
Hi,
How can I use OR in second level attributes ? (attributes that´re in a
aggregate Class of a aggregate Class of main Class)
when
$trigger : ArrayList( size >= 1 )
from collect( PromotionShoppingCartLine( productItem.sku == "1" ||
productItem.sku == "2" ) from
$promotionShoppingCart.promotionShoppingCartLines )
then
.
.
I can´t use "productItem.sku" (sku attribute inside productItem attribute
that´s inside PromotionShoppingCartLine class) if I´m using the || (OR), but
if I use && (AND) all works fine.
thanks in advance,
Sergio Stateri Jr.
stateri(a)gmail.com
--
Sergio Stateri Jr.
stateri(a)gmail.com
16 years, 5 months
Working memory view is empty
by Marina
Hi,
It might be something very simple, but I can't see it. I use Eclipse 3.3 with JBoss Rules 4.0.7 plugin.
I'm trying to debug my rules , but no matter what breakpoints I set I can never get anything in the Working Memory or Agenda views.
I tried setting a normal Java breakpoint on the session.fireAllRules() method -- it stops before calling the method, I select the session variable in the Debug Variables view - but nothing is displayed in the Working Memory view. I even tried to step into the fireAllRules() method - but the Working Memory view is empty at all times.
Then I tried to set a rules breakpoint in a "then" part of my rule - this time Eclipse does not even stop there, instead, it stops on the statement after the call to the fireAllRules() method.
Do I have something mis-configured??
thanks,
Marina
16 years, 5 months
concrete query methods
by thomas kukofka
Hello,
supposed I have rules sets for different issues and operating on different
facts. Now I want to write an interface for users who don't want to be
bothered with details of the Drools API and who wish interface methods which
returns results for concrete questions like:
ResultFact getAnswerForQuestionXY()
How can such a concrete query be implemented?
My first idea was to store the result fact with the help of globals:
rule "XY"
when
FactX ()
then
ResultFact resultFact = new ResultFact();
service.addResultFact(resultFact);
insert(resultFact
);
end
So my method would only return something like service.getResultFact().
I don't know if there are better solutions or if it is unusual to use
methods for concrete queries.
Kind regards
Thomas
16 years, 5 months
LHS reuse?
by Barry Kaplan
I have a set of rules that /all/ contain the following condition...
positionQuantityAllocatedToLegs :
Integer(intValue < position.quantity)
from accumulate( StrategyLeg(priority > 1, instrument == equity,
longShort ==
LongShort.LONG, legQuantity : quantity )
legsQuantity(legQuantity) )
...the only difference being the values for the StrategyLeg.
It would be very nice if there was some way to create reusable LHS
constructs, say maybe something like:
positionQuantityAllocatedToLegs : legsAllocation(1, position.quantity,
LongShort.LONG)
Where 'legsAllocation' is replaced with the condition above. Is there such a
mechanism, or need I simply live with large amounts of duplication in my
LHS?
thanks!
--
View this message in context: http://www.nabble.com/LHS-reuse--tp17986260p17986260.html
Sent from the drools - user mailing list archive at Nabble.com.
16 years, 5 months
RuleFlow Groups and retraction
by Markus Helbig
Hi,
one question about using ruleflows:
1. i have a ruleflow consisting of 2 Nodes
2. i insert 2 facts
3. the 2 facts match the condition in rule for the second node, so
when inserting an activation is generated
4. but the rule in the first node will retract one of the 2 facts
5. it seems the activation for the second node is not cancelled also i
do a retract in the rule
6. now the activation in second node tries to execute and results in a
NullpointerException
What do i do wrong?
Cheers
Markus
16 years, 5 months
Is there a way to preventing the Agenda to not match against ALL rules when inserting a fact object
by Amit Mhatre
Hi,
I am migrating one of my projects to using the drools rule-flow. I have a
bunch of RuleFlowGroups and just 1 fact object (where I am iterating over an
external list and hence I execute the RuleFlow tens of thousands times,
inserting a new fact object for each element in my list). Each RuleFlowGroup
is a logical set of rules that would set a certain variable in the
FactObject and eventually after the flow is executed, the last RuleFlowGroup
will return the outcome based on the variable set by the previous
RuleFlowGroups. I am using a statelessSession.
The problem I am facing is that when I insert the FactObject into the
workingMemory - then the data points needed by ALL the rules across ALL the
RuleFlowGroups are gathered, i.e. the getter beans for all variables used
across all the RuleFlowGroups are invoked. The activations take place
according to the ruleFlow, but the data is gathered for all the rules
(though my flow might not reach certain groups).
The thing is, this behavior is not ideal for the task I am working with,
since some of the data points are pretty expensive to be gathered (requiring
expensive queries to be executed). What I'd ideally like is that the data be
gathered only for one RuleFlowGroup at a time, since my rules are structured
such a way that only a fraction of the evaluations should actually need the
expensive data points. The data be gathered for the rules in a ruleFlowGroup
only when that group is active. I understand that this might take a hit for
the efficiency of the matching algorithm, but it would be ideal for my task.
I've dug through the documentation for AgendaGroups, SequentialMode etc,
but nothing seems to be working for me.
Has somebody faced a similar problem? Could somebody point me in the
direction I should be following to resolve this? Any help would be greatly
appreciated.
Thanks,
- am
16 years, 5 months
logging
by Thalupula Ravi
Hi,
How can i log that where a rule is executed or not for supplied data? If the
rule fires, in 'then' section i can have a log statement.
How can i log that the rule is not executed??
I need to log in both scenarios.
Thanks,
Ravi Thalupula
--
View this message in context: http://www.nabble.com/logging-tp17779598p17779598.html
Sent from the drools - user mailing list archive at Nabble.com.
16 years, 5 months
Rule is firing on those objects for which that has already fired
by siddhartha banik
Hi All,
I am using Drools Stateful session with serialized Rule Base & Working
memory for my application. I need to write some rule which will *only* fire
on newly inserted data points in Working Memory. Does Drools support any
such feature which will help me to achieve this ? Any suggestion, how can I
achieve this efficiently?
As sample, I have written a rule bellow:
global RuleSetOutput ruleSetOutput
rule "sample_rule"
when
(p4: DataObject(id == 4, stringValue == "230007014")) and
(p14: DataObject(id == 14, stringValue == "230007004")) and
(p10: DataObject(id == 10, stringValue == "230007005")) and
(p11: DataObject(id == 11, stringValue == "230007006")) and
(p12: DataObject(id == 12, stringValue == "230007007")) and
(p13: DataObject(id == 13, stringValue == "230007008"))
then
String ruleID = "sample_rule";
RuleOutput ruleOutput =
RuleEngineHelper.getRuleOutput(ruleSetOutput, ruleID);
ruleOutput.addDataObject(p13);
ruleOutput.addDataObject(p4);
ruleOutput.addDataObject(p11);
ruleOutput.addDataObject(p14);
ruleOutput.addDataObject(p10);
ruleOutput.addDataObject(p12);
end
For 1st execution, I am inserting 6 matching DataObjects into Working
Memory. Rule is getting fired once & those 6 data points are getting added
into RuleOutput.
But in subsequent rule executions after I insert 6 more matching DataObjects
into Working Memory, Rule is getting fired couple of times & objects from
old executions also getting appended to the current RuleOutput.
How can I avoid this ?
Regards
Siddhartha
16 years, 5 months