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
2 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
2 weeks, 1 day
Multi-threading / Parallelism in Drools
by Anitha Naduvath
HI all ,
Mine is a microservice (REST based stateless endpoint )running on the
cloud. Our service mainly deals with Invoices , where the Items of the
Invoice need to be evaluated against a set of rules .
We are now evaluating Drools to implement these business rules .
I have the following query with respect to Multi-threading / Parallelism
options in Drools.
*Use Case 1 :*
Our service receives an invoice with say 15000 Items , to be processed . We
need to evaluate the same set of rules for each of the items. It is Ok to
process each item in parallel . How do I achieve this in Drools ?
*Use case 2:*
Our service is called from 100 different end users . Such users may have
invoices ranging from 1 item to 15000 items in the invoice . How do I make
sure that the I maintain the same response time for all ? Should I use KIE
Execution Server which is a standalone exceution server ? In such a case,
is this server something like another microservice ? . So, will there not
be performance issues in making a REST call from my service to the KIE
Execution Server ? On the other hand , if I embed the runtime in my
application, then will it mean that I kind of tie the runtime One to One to
the user request ?
What is the best approach for the runtime considering both the use cases
here ?
*Also, can anybody explain what they mean in section 1.3.1.3 of the Drools
documentation
<https://docs.jboss.org/drools/release/6.5.0.Final/drools-docs/html_single...>:*
- 1.3.1.3. Runtime
The "runtime" requirements mentioned here are if you are deploying rules as
their binary form (either as KnowledgePackage objects, or KnowledgeBase
objects etc). This is an optional feature that allows you to keep your
runtime very light. You may use drools-compiler to produce rule packages
"out of process", and then deploy them to a runtime system. This runtime
system only requires drools-core.jar and knowledge-api for execution. This
is an optional deployment pattern, and many people do not need to "trim"
their application this much, but it is an ideal option for certain
environments.
Thanks!
Anitha .
8 years, 11 months