Bad version number in class file
by Shigeaki Wakizaka
Hi.
I just downloaded Drools 5.0.0.MR2 IDE from Drools site,
and i put the unzipped directory in my eclipse installed directory.
When I just create a Drools project, "Bad version number in class file"
with Sample.drl file appears in the problem view.
What should I do?
I'm using Ganymede , by the way.
Thanks in advance.
waki
16 years, 1 month
Jbpm and drools
by benjamin@romney.dk
After looking at jbpm and drools I got a bit confused. It seems like
drools can do the same kind of work as e.g. jbpm bpel using rule flow and
work items. I am just wondering why I should bother learning jbpm when
drools are available.
Can someone please enlighten me on this matter?
16 years, 1 month
Parameterized getters/setters?
by clausiam
I have a database where an object may have a dynamic set of property values
(dynamic list of "fields" if you will) based on configurations done by a
user.
So, object A may have properties: Description, Length, Width and object B
may have properties Description, Input voltage, Power output. I need to be
able to write rules for any object (it can be assumed that the person
writing the rule knows which properties the objects that are acted on have,
but my type declarations have to be able to handle the dynamic properties).
Something like this (lame example, but it illustrates the point)
rule "Test"
when
$obj:DBObject()
eval($e.getProperty("Width") == $e.getProperty("Length"))
then
$e.setProperty("IsSquare", true); //Assume IsSquare is a property
that all objects have
end
--
View this message in context: http://www.nabble.com/Parameterized-getters-setters--tp20427624p20427624....
Sent from the drools - user mailing list archive at Nabble.com.
16 years, 1 month
Rule processing for High volume input
by techy
I have to run rules(1000 rules) against 20-30 million of record each day.
I guess I would have memory issue If I insert all of records into working
memory.
so I'm thinking to have multiple rule base instance and do batch processing
as given below.so that I can avoid memory issue and quick rule processing
a.Take first 1 million records and distribute 1 millon across working
memory of 5 rule base.
b.fire rules in all 5 rule base
c.clear working memory of all rule base
d. take next 1 million record and start from step-a till I process all of
the records.
Please advise whether this is possible/recommended way or not.
thanks
--
View this message in context: http://www.nabble.com/Rule-processing-for-High-volume-input-tp20370272p20...
Sent from the drools - user mailing list archive at Nabble.com.
16 years, 1 month
Using Hashmap in drl files......
by Nikhil_dev
Below is the drl file
package com.vtech.ruleengine.module.rulemanagermodule
import com.vtech.ruleengine.module.rulemanagermodule.RuleAttributes;
import java.util.Map;
rule "Rule_dec_1"
dialect "mvel"
when
$a : RuleAttributes()
m : RuleAttributes ( eval( ($a.getValues().get("AdultFare") -
$a.getValues().get("InfantFare")) < ($a.getValues().get("ChildFare") +
$a.getValues().get("InfantFare") ) )
then
eval($a.getValues().put("GrossFare", 500))
end
Follwing is the way i am using drrols
final StatefulSession ruleStateSession =
ruleBase.newStatefulSession();
ruleStateSession.addEventListener( new DebugAgendaEventListener()
);
ruleStateSession.addEventListener( new
DebugWorkingMemoryEventListener() );
RuleAttributes objRuleattri = new
RuleAttributes((HashMap<String, Object>)_hmListBean);
ruleStateSession.insert(objRuleattri);
ruleStateSession.fireAllRules();
Note : RuleAttributes is a class where i set getter and setter for hashmap
Below is the error message that i get :
[9,0]: unknown:9:0 mismatched token: [@122,385:388='then',<61>,9:0];
expecting type RIGHT_PAREN
ERROR 1 ::getCause::: null
ERROR 2 ::getLocalizedMessage::: Unable to compile drl
ERROR 3 ::getMessage::: Unable to compile drl
ERROR 4 ::toString::: java.lang.RuntimeException: Unable to compile drl
Gross VAlue ::::: 0
java.lang.RuntimeException: Unable to compile drl
It will be very helpful is anyone of you rectify my mistake or tell me any
other way to use Hashmap in drl file.
I am using hashmap, since variable in my application varies hence cannot
define fixed Bean structure.
-----
Regards,
:working:Nikhil
--
View this message in context: http://www.nabble.com/Using-Hashmap-in-drl-files......-tp20355904p2035590...
Sent from the drools - user mailing list archive at Nabble.com.
16 years, 1 month
Drools Flow - new variables
by Michal Bali
Hello,
Is there a way to define new variables within ruleflow?.
If I try to set variable that hasn't been declared in the ruleflow header -
the variables section. I get following error:
"Could not find variable someVariableName
Continuing without setting value"
I am using following code:
context.setVariable("someVariableName", "someValue");
I need this for couple of reasons:
- I have a custom *generic* WorkItem that has some parameters. I want to
set them *dynamically* at runtime. Ideally, define new variables in onEntry
and then map them with an in-mapping.
- in a subflow, the subflow calculates some value, I'd like to store this
value as variable and then use the out-mapping to propagate it to the parent
ruleflow.
I can't find any examples/test cases doing this.
Is there a way to define new variables within ruleflow?.
Thanking you in advance.
Best Regards,
Michal
16 years, 1 month
rule execution order
by techy
If I have r1,r2,r3, execution flow has to be
1. fire r1 first
2.then fire r2 if r1 was fired
3.then fire r3 if r1 got executed & r2 was not fired
then i can think of following way using salience and control flag.
rule r1
salience 10
when r1 condition
then
fact.r1Executed = true
do something
end
rule r2
salience 9
when fact.r1Executed == true
then
fact.r2Executed = true;
do someting
end
rule r3
salience 8
fact.r1Executed == true && fact.r2Executed == true
then
do something
end
I could not implement this using agenda group. Esp how to control r3 using
agenda group
Please advise if we can do it better way without using rule flow.
--
View this message in context: http://www.nabble.com/rule-execution-order-tp20370492p20370492.html
Sent from the drools - user mailing list archive at Nabble.com.
16 years, 1 month
Independent rule evaluations
by Yuri
Considering that I have a set of rules that can be time consuming to assert is
there a way to separate them from other rules without having to resort to
multiple working memories?
I basically want to be able to assert facts and evalute a set of rules as fast
as I can before actually having the time consuming set of rules evaluate.
thanks,
16 years, 1 month
Collection in working memory!
by vanshi
Hi all,
I'm new to Drools and have a simple question. In my program I have a
collection A of objects B, and each B object has 30-40 attributes. And the
rule run against these attributes of B. I want to run rules against each
instance of B and I 've close to 45 rules. These rules can be grouped under
3 categories and at a time just 1 group need to be applied for a particular
object....point is that there is no need to blindly run an object against
all rules. Now with this background, I would love to hear what is the best
implementation?
I have put rules in 3 different DRL file and packaged them into single Rule
base. For inserting the facts in working memory, I'm iterating through
collection and inserting one B object at a time in Working memory and then
firing all rules of any one group (for that I'm using
RuleNameEndsWithAgendaFilter()). How bad is this design? Because I can see
for 100 objects I'm inserting facts in working memory 100 times and then
firing rules 100 times. I can make the top level collection 'A' global(or
insert 'A' in WM) and then iterate over it from the rule file ...would that
be a better solution?
Would appreciate any input in this regard. Thanks.
--
View this message in context: http://www.nabble.com/Collection-in-working-memory%21-tp20298166p20298166...
Sent from the drools - user mailing list archive at Nabble.com.
16 years, 1 month