Why no breakpoints in drl files ??
by Michael Zimmermann
Hi there,
well, in one project I do have the problem that from within eclipse while
debugging the application breakpoints in drl files are not recognized,
i.e. the application does not stop on aline if this line is executed.
Weirdly, a second project in the same eclipse installation does not show
this behaviour.
The problematic project
- is converted to a drools project
- is started via "debug as > drools"
- has the breakpoint set in a rule consequence (system.out) that gets
executed
Any ideas what might be the reason for such a behaviour?
thanks and cu, Michael
PS: I doubt that it is the fault of my eclipse installation because the
second drools test project works fine.
17 years, 1 month
Re: [rules-users] 'or' with predicate/return val/inline eval with property issue?
by Michal Bali
Hi Edson,
I've created new JIRA issue - JBRULES-1337
Thank you for your time on this.
Regards,
Michal
----- Original Message ----
From: Edson Tirelli <tirelli(a)post.com>
To: difranr(a)alumni.pitt.edu; Rules Users List <rules-users(a)lists.jboss.org>
Sent: Wednesday, 21 November, 2007 12:48:54 PM
Subject: Re: [rules-users] 'or' with predicate/return val/inline eval with property issue?
Ronald,
In my tests, it works if you use a simple constraint. The problem only happens with constraints that use semantic code.
I tracked down the problem and it is in the LogicTransformer that is used when an "or" CE is present.
[]s
Edson
2007/11/21, Ronald R. DiFrango <ron.difrango(a)gmail.com>:
One question do you get different reslts if you do the folowing for the first rule:
Message( message == "somethingDifferent" ) # this should never match
All I did was eliminate the eval and the explicit call to equals
On Nov 21, 2007 4:05 AM, Michal Bali <
michalbali(a)yahoo.ie> wrote:
Hi,
I have following rule that should never fire, but it does :)
package com.sample
import com.sample.DroolsTest.*
;
rule "ruleThatShouldNeverFire"
when
Message( eval("somethingDifferent".equals(message)) ) # this should never match
SomeBeanA( ) or SomeBeanB( )
then
System.out.println( drools.getRule().getName() + " fired and shouldn't" );
end
stateful ruleSession with following
insertions:
Message message = new Message();
message.setMessage( "Hello World" );
workingMemory.insert( message );
workingMemory.insert( new SomeBeanA() );
workingMemory.insert( new SomeBeanB() );
It behaves the same way if we use predicates or retun values:
#Message( msg : message -> ("somethingDifferent".equals (msg)) ) # this should never match
#Message( message == ("somethingDifferent".equals (message)) ) # this should never match
It looks like the AlphaNode is missing from
the Rete network.
Tested with Drools 4.0.3. Java build 1.5.0_11-b03.
Any ideas if this is a bug or am I doing something wrong?
Thanks.
Regards,
Michal
Send instant messages to your online friends
http://uk.messenger.yahoo.com
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
--
Edson Tirelli
JBoss Drools Core Development
Office: +55 11 3529-6000
Mobile: +55 11 9287-5646
JBoss, a division of Red Hat @ www.jboss.com
Send instant messages to your online friends http://uk.messenger.yahoo.com
17 years, 1 month
looping due to immediate retraction
by John J. Franey
OK. It took me a few laps with the debugger to understand what is happening
with the following:
rule
when
$assignment: Assignment($resource: resource)
not Booking(resource == $resource)
then
insertLogical(new Booking($resource));
end
Basically, in the rhs the insertion of the new Booking causes the lhs to be
reevaluated, and since in the reevaluation, there IS a Booking, it is
retracted. Then the lhs is reevaluated to see that there is NOT a Booking,
and so the rhs is run again, and loop and loop and loop.
But what I don't understand, is if I add an update in the rhs like this:
rule
when
$assignment: Assignment($resource: resource)
not Booking(resource == $resource)
then
update($assignment);
insertLogical(new Booking($resource));
end
there isn't a loop. I didn't take the journey with the debugger to answer
this question, but am still wondering: why does the update break the
infinite loop?
Thanks,
John
--
View this message in context: http://www.nabble.com/looping-due-to-immediate-retraction-tf4847517.html#...
Sent from the drools - user mailing list archive at Nabble.com.
17 years, 1 month
'or' with predicate/return val/inline eval with property issue?
by Michal Bali
Hi,
I have following rule that should never fire, but it does :)
package com.sample
import com.sample.DroolsTest.*;
rule "ruleThatShouldNeverFire"
when
Message( eval("somethingDifferent".equals(message)) ) # this should never match
SomeBeanA( ) or SomeBeanB( )
then
System.out.println( drools.getRule().getName() + " fired and shouldn't" );
end
stateful ruleSession with following insertions:
Message message = new Message();
message.setMessage( "Hello World" );
workingMemory.insert( message );
workingMemory.insert( new SomeBeanA() );
workingMemory.insert( new SomeBeanB() );
It behaves the same way if we use predicates or retun values:
#Message( msg : message -> ("somethingDifferent".equals (msg)) ) # this should never match
#Message( message == ("somethingDifferent".equals (message)) ) # this should never match
It looks like the AlphaNode is missing from the Rete network.
Tested with Drools 4.0.3. Java build 1.5.0_11-b03.
Any ideas if this is a bug or am I doing something wrong?
Thanks.
Regards,
Michal
Send instant messages to your online friends http://uk.messenger.yahoo.com
17 years, 1 month
DSLs in the Guided Rule Editor, Still do not works
by mmquelo massi
Hi Guys,
I am experiencing something which was already posted a couple of weeks ago.
I finally defined my own "rule.package" file with all the imports I
needed in order
to get the class names, coming out from the wizard window.
By the time I have a .dsl definition within the Drools Rule Project
(IDE 4.0.3 on Eclipse 3.3)
I decided to use the .dsl sentences in the Guided editor.
So, when I define the "when" condition everything goes smoothly.
When I decide to pick up a sentence (a dsl occurrence) from the action
field, eclipse
gives me back an error on the .brl file.
So the problem comes out once I want to add a dsl sentence
using the guided rule editor.
I think Shahad Ahmed experienced the same issue.
Thank You anyway.
Massi
17 years, 1 month
howto BRMS - already stuck at fact model loading
by Darren Hartford
Hey all, new to BRMS as trying to learn how this works. My usecase is
to take an existing, working EJB3 application and migrate some of the
complex rules over to be managed by BRMS.
However, initial attempts over the course of a couple of days have
yielded zero results.
When trying to follow
http://downloads.jboss.com/drools/docs/4.0.3.15993.GA/html_single/index.
html#d0e5301, they want you to load a fact model. I take an existing
EJB3 entity bean and it loads fine. There doesn't seem anything more
for me to do, or to verify this is o.k. or not. So, then I move to the
rule editors, and nothing works - not able to use the guided editor at
all, and using the DSL text editor with the 'model/entity' from the jar
isn't recognized.
Now, I admit ignorance, and I would like some direction as to how to
best learn to use BRMS.
There were a couple mentions of a drools-examples-brms, but it just can
not be found. Following the documentation mentioned above is only
guidelines without any good examples leaving one easily lost.
http://www.google.com/search?q=drools-example-brms
http://www.nabble.com/forum/Search.jtp?query=jbrms+example&local=y&forum
=11822&daterange=0&startdate=&enddate=
http://labs.jboss.com/drools/downloads.html
http://labs.jboss.com/drools/livetrails/index.html
So - where can one go to learn how to use BRMS to help convert an
existing EJB3 application to use Drools and BRMS?
Thanky,
-D
17 years, 1 month
Re: [rules-users] Query Problem
by Ronald R. DiFrango
Mark,
I am certain that this is a bug. In my rules, I was able to make it work
where I leave the "Open" lines on he agenda and he query does in fact pick
them up.
I wil see if I can create a small test case that demonstrates the problem.
What is the link to JIRA so I can log it.
Ron
On Nov 17, 2007 12:17 PM, Mark Proctor <mproctor(a)codehaus.org> wrote:
> Ronald R. DiFrango wrote:
>
> All,
>
> I have the following query:
>
> query "Open RTV Lines"
> line : DetailLine(status in (StatusConstants.OPEN,
> StatusConstants.PARTIALLY_MATCHED))
> end
>
> And what appears to be happening is it is only picking up those lines that
> are marked with StatusConstants.PARTIALLY_MATCHED and not those marked
> with StatusConstants.OPEN.
>
> Now here is the rub, if a line gets marked as StatusConstants.OPEN then it
> gets pulled off the agenda for further processing. Could this be why it is
> not getting picked up by the query?
>
> The agenda thas nothing to do with querries. This should work. If you
> believe its a bug, then please open a JIRA with a self contained executiable
> test.
>
>
> Ron
>
> ------------------------------
>
>
17 years, 1 month
Multipattern collect
by Geoffrey De Smet
Is a multipattern collect supported?
I have a rule which finds all 2 topics and all the students they share
if there is at least 1 such student:
rule "calculateTopicConflict"
when
$leftTopic : Topic($id : id);
$rightTopic : Topic(id > $id);
$studentSet : HashSet( size > 0 )
from collect(
$student : Student(),
$leftTopic.studentList contains $student,
$rightTopic.studentList contains $student
);
then
insertLogical(new TopicConflict($leftTopic , $rightTopic ,
$studentSet));
end
This won't compile:
Caused by: org.drools.rule.InvalidRulePackage: [29,36]: unknown:29:36
mismatched token: [@370,1504:1504=',',<11>,29:36]; expecting type
RIGHT_PAREN[30,39]: unknown:30:39 mismatched token:
[@376,1545:1552='contains',<49>,30:39]; expecting type
LEFT_PAREN[30,48]: unknown:30:48 Unexpected token '$student'
at org.drools.rule.Package.checkValidity(Package.java:424)
Is a multipattern collect supported?
Thanks for your help :)
--
With kind regards,
Geoffrey De Smet
17 years, 1 month
Using multiple RuleFlows with similar group names
by james_d
Hi,
I've built a RuleBase comprised of 2 ruleflows and their respective rules.
Each ruleflow is defined in a separate package however both use a common set
of ruleflow-group names. It looks something like this:
Ruleflows: Flow 1, Flow 2
Flow 1 package: com.test.flow1
Flow 1 ruleflow groups: Group A, Group B, Group C
Flow 2 package: com.test.flow2
Flow 2 ruleflow groups: Group A, Group B, Group C
When I load both packages into a RuleBase and insert an Object, I see that
rules in both Flow 1 and Flow 2 are executed, even though only ruleflow
process "Flow 1" was started. In short, it appears that Drools does not
take a rule's package into consideration when executing a ruleflow. Is this
expected behavior?
My understanding was that the rules in Flow 2 should not be executed because
they are in a different package.
I welcome any input.
--
View this message in context: http://www.nabble.com/Using-multiple-RuleFlows-with-similar-group-names-t...
Sent from the drools - user mailing list archive at Nabble.com.
17 years, 1 month