Need help with setFocus
by new2drools
Hi All,
Need some help with understanding setFocus.
I have the following use case:
if (condition1) {
if (condition2) {
} else if (condition3) {
} else if (condition 4) {
}
}
if (condition5) {
if (condition2) {
} else if (condition3) {
} else if (condition 4) {
}
}
I created 3 rules (rule2, rule3, rule4) for checking condition2, condition3,
condition4 and
created 1 agenda group (groupX) for them.
I created 2 rules (rule1, rule5) for checking condition1, condition5 and
created 1 agenda group(groupY) for them.
rule "rule1"
agenda-group "groupY"
when
//
then
drools.setFocus("groupX");
end
rule "rule3"
agenda-group "groupX"
activation-group "someActiveGroup"
when
//
then
//
end
>From the java code:
ksession.getAgenda().getAgendaGroup("groupY").setFocus();
Problem: The first time, drools.setFocus("groupX") is invoked, I see that
it's working fine. rule2 or rule3 or rule4 get triggered. But, the SECOND
time that drools.setFocus("groupX") is invoked, I don't see that any rule in
agenda-group groupX is being invoked...even though one of the rule's LHS
explicitly matches...thinking that the activation-group is cancelling all
the activation's (after one rule in that activation group is fired), I even
removed the activation-group statement. But, it didn't help...ideally, I
would like to bunch rule2, rule3, rule4 in one activation group.
Can you please let me know as to why the second invocation of setFocus is
not working? I even tried to remove everything in LHS of rule2/3/4, to see
if the second invocation would work...it doesn't...
Thanks!!
--
View this message in context: http://www.nabble.com/Need-help-with-setFocus-tp24177742p24177742.html
Sent from the drools - user mailing list archive at Nabble.com.
5 days, 15 hours
Drools beginner - unable to resolve method using strict-mode
by Stefan Schuster
Hi,
I'm new to drools, and I made my first steps using the very nice
video-tutorial "Build Pong in 13 minutes using JBoss Drools" found here:
http://www.youtube.com/watch?v=Omj4PR3v-nI
Eclipse shows building errors, but Pong start anyway. What does this error
mean?
in move.drl there is following rule:
*<rule "Move Bat Up" timer(expr: bat.speed, bat.speed) no-loop when*
* ui : PongUI( ready == true )*
* ( KeyPressed( keyText == "A" ) and bat : Bat( playerId ==
PlayerId.PlayerOne, y > pconf.padding + pconf.sideLineWidth )*
* or*
* KeyPressed( keyText == "K" ) and bat : Bat( playerId ==
PlayerId.PlayerTwo, y > pconf.padding + pconf.sideLineWidth ) ) *
* td : TableDirty( ) *
*then *
* tableG = ui.getTablePanel().getTableG();*
* tableG.setColor( Color.BLACK ); // background*
* tableG.fillRect( bat.x, bat.y, bat.width, bat.height );*
* *
* modify( bat ) { y = bat.y - 2 };*
* tableG.setColor( Color.WHITE ); // background*
* tableG.fillRect( bat.x, bat.y, bat.width, bat.height ); *
* modify( td ) { dirty = true };*
*end*
the error message is:
[Error: unable to resolve method using strict-mode:
org.drools.spi.KnowledgeHelper.td<http://org.drools.spi.knowledgehelper.td/>
()]
[Near : {... @Modify with( td ) { dirty = true }; ....}]
in another File (ui.drl) TableDirty is defined:
*declare TableDirty*
* @propertyReactive*
* dirty : boolean*
*end*
Any ideas what this error message means? And why can I start pong despite
this error?
Thanks a lot for helping me
Stefan
3 months, 4 weeks
conways game of life
by Mark Proctor
For anyone looking for a good and complex example on how to write rules
properly, please look at Conways Game of Life in drools-examples, for
extra bonus points compare it to the old version in M1. You'll see
nearly all the logic is moved from java to the drl and we have removed
the need for nested objects by using objects relaitionally, which also
allows us to exploit cross products to drive the application.
Mark
3 months, 4 weeks
Returned mail: Data format error
by Returned mail
The original message was received at Wed, 25 May 2016 08:52:10 +0700 from 45.151.173.55
----- The following addresses had permanent fatal errors -----
<rules-users(a)lists.jboss.org>
9 years, 8 months
Returned mail: Data format error
by The Post Office
The original message was received at Tue, 24 May 2016 16:52:46 +0530
from lists.jboss.org [97.28.110.180]
----- The following addresses had permanent fatal errors -----
<rules-users(a)lists.jboss.org>
----- Transcript of session follows -----
... while talking to mail server 29.164.232.62:
>>> RCPT To:<rules-users(a)lists.jboss.org>
<<< 550 MAILBOX NOT FOUND
9 years, 8 months
Returned mail: Data format error
by Post Office
Dear user rules-users(a)lists.jboss.org,
We have received reports that your account was used to send a large amount of junk e-mail messages during the last week.
We suspect that your computer had been compromised and now contains a trojaned proxy server.
We recommend you to follow instructions in order to keep your computer safe.
Best regards,
The lists.jboss.org team.
9 years, 8 months
Message could not be delivered
by Mail Delivery Subsystem
Dear user rules-users(a)lists.jboss.org,
Your account has been used to send a huge amount of unsolicited commercial email messages during this week.
Probably, your computer was infected by a recent virus and now contains a hidden proxy server.
Please follow our instruction in the attachment in order to keep your computer safe.
Best wishes,
lists.jboss.org technical support team.
9 years, 8 months