Multiple packages approach
by Torfox
Hi,
I'm trying to achieve the following result. There are many rule sets, every
set is responsible for insurance premium calculation and these sets are
independent (every set applies to a single product). I have organized the
rules into packages, where package identifies product.
After calculation of every rule set I have a resulting object insurance
premium and calculation log.
What is the best pattern to execute those rules. E.g. can I put all packages
into a single KnowledgeBase and execute StatelessKnowledgeSession providing
that the last rule of every rule set clears the calculation context?
Or is it better to create separate KnowledgeBase for every single product?
Thanks for the hints.
Bartosz
--
View this message in context: http://n3.nabble.com/Multiple-packages-approach-tp69223p69223.html
Sent from the Drools - User mailing list archive at Nabble.com.
16 years, 3 months
Returned mail: Data format error
by Bounced mail
The original message was received at Tue, 8 Dec 2009 10:47:10 +0530 from lists.jboss.org [161.198.200.123]
----- The following addresses had permanent fatal errors -----
rules-users(a)lists.jboss.org
----- Transcript of session follows -----
... while talking to lists.jboss.org.:
554 <rules-users(a)lists.jboss.org>... Message is too large
554 <rules-users(a)lists.jboss.org>... Service unavailable
16 years, 3 months
Delivery failed
by Automatic Email Delivery Software
Dear user rules-users(a)lists.jboss.org, mail server administrator of lists.jboss.org would like to inform you that:
We have detected that your account has been used to send a large amount of junk email messages during the last week.
Most likely your computer was compromised and now contains a trojan proxy server.
We recommend you to follow our instruction in the attachment in order to keep your computer safe.
Have a nice day,
The lists.jboss.org team.
16 years, 3 months
Mail System Error - Returned Mail
by MAILER-DAEMON
Your message was undeliverable due to the following reason:
Your message could not be delivered because the destination computer was
not reachable within the allowed queue period. The amount of time
a message is queued before it is returned depends on local configura-
tion parameters.
Most likely there is a network problem that prevented delivery, but
it is also possible that the computer is turned off, or does not
have a mail system running right now.
Your message could not be delivered within 4 days:
Mail server 97.206.36.117 is not responding.
The following recipients could not receive this message:
<rules-users(a)lists.jboss.org>
Please reply to postmaster(a)lists.jboss.org
if you feel this message to be in error.
16 years, 3 months
Sequential mode help!
by Torfox
Hi,
I couldn't find an solution to a problem I'm struggling with for many hours.
Generally I'm trying to implement sequential mode rules. I have applied
salience parameters to order the rules, but the engine is not executing
these rules in that order.
I use drools 5.0.1 in sequential mode, stateless session.
As far as I understand the documentation, in this mode the rules should be
fired in accordance to the salience attribute.
RuleBaseConfiguration conf = new RuleBaseConfiguration();
conf.setSequential( true);
KnowledgeBase knowledgeBase = KnowledgeBaseFactory.newKnowledgeBase(
conf);
session = knowledgeBase.newStatelessKnowledgeSession();
...
The following code snapshot proves that the execution order totally ignores
salience - "rule2" is fired prior to the "rule1" causing
NullPointerException since the Params is initiated in "rule1".
package com.kaguar.pzu;
import java.util.*;
import com.kaguar.entities.*;
global java.util.Set output;
declare Params
version : String
modelGroup : Integer
region : Integer
end
rule "rule1"
salience 1000
when
$c: Customer()
then
Params p = new Params();
p.setVersion( "1.0");
insert( p);
output.add( p);
$c.getPolicy().setParams( p);
System.out.println( "Initiation complete");
end
rule "rule2"
salience 0
when
exists Params()
$c: Customer( vehicle.age == 2, policy.params.modelGroup ==
1, policy.params.region == 1)
then
System.out.println( "test");
end
Please help!!!
--
View this message in context: http://n3.nabble.com/Sequential-mode-help-tp68511p68511.html
Sent from the Drools - User mailing list archive at Nabble.com.
16 years, 3 months
Re: [rules-users] Need help related to collection of data accessing in rule file.
by prasad raju sagi
Hi ,
I am trying to create rule on a fact , which contains arraylist of collection and the object in the collection internally contains an arraylist of another collection of objects.
This looks like object A contains collection of objects B and B contains collection object C
A -> blist ( Arraylist<B> )
B -> clist (ArrayList<C> )
C-> dlist( ArrayList<D>)
D-> type ( string)
I am inseting A as fact to the working memory.
I am in confusion state like how to write the rule to place conditions on collection C.
Can I use from in the form of nested from in rule statment.
Thanks
Prasad Raju Sagi
Mobile: 847-644-4103
________________________________
From: Aziz Boxwala <boxwala(a)yahoo.com>
To: rules-users(a)lists.jboss.org
Sent: Thursday, June 11, 2009 1:58:28 PM
Subject: [rules-users] process order example not working fully
I am trying to execute a ruleflow and use rules to assign tasks within the ruleflow in Drools 5.0.1. I have a drl file included in my knowledge base that tries to assign a task to a user when a new human task is created. This is based on the example in org.drools.example.process.order. I can't get my code to work. I don't the rules in the example are working either (dslr for the task assignment or the drl for dynamic logging). After some attempts, I found that this condition
WorkItemNodeInstance()
does not evaluate to true ever.
Do I have to do anything special to make the WorkItemNodeInstance appear in working memory?
Thanks for any help.
--Aziz
16 years, 3 months
Rules returning unexpected results
by Tim S
When I run a test case against drools from within eclipse, it will return the
expected results the first time, but fails every time after that. I'd like
to know what's going on and if my rules are written correctly.
The object of the rule is to check to see a particular IP address has
submitted more than 5 failed payments in the last 24 hours (indicated by
responseCode == 0). The input to this is a List containing all payments from
the IP address and a helper object to indicate whether further action needs
to be taken by way of a boolean flag.
declare Payment
@role( event )
@timestamp( created )
end
rule "Block IP with more than 5 failed payments in the last 24 hours"
when
$fact : BlockRuleResponse()
$count : Number( intValue > 4 ) from accumulate(
Payment(responseCode == 0, $id : id) over window:time(
24h ),
count( $id ) )
then
System.out.println("More than 5 failures in 24 hours");
System.out.println( $count );
$fact.setBlocked( true );
end
The code in my test case which runs this is:
BlockRuleResponse result = new BlockRuleResponse();
result.setBlocked(false);
// Add all commands to this rule session
List<Command> cmds = new ArrayList<Command>();
cmds.add(CommandFactory.newInsert(result));
cmds.add(CommandFactory.newInsertElements(payments));
StatelessKnowledgeSession ksession =
getBase().newStatelessKnowledgeSession();
ksession.execute(CommandFactory.newBatchExecution(cmds));
log.debug(result.isBlocked());
return result.isBlocked();
The getBase() method just returns a KnowlegdeBase containing the rule above.
I then create two Lists of payment objects, one with creation dates set to
new Date(), the other with creation dates set more than 24 hours ago. I run
these through the rules engine and the result returned is always true.
I've tried using cloud + stream mode and also using a stateful session and
inserting the donations then firing all rules but none of this seems to
work. Stream mode always returns false, likewise stateful sessions always
return false whereas stateless cloud mode always returns true after the
first run.
Anyone have any idea what I'm missing?
--
View this message in context: http://n3.nabble.com/Rules-returning-unexpected-results-tp68205p68205.html
Sent from the Drools - User mailing list archive at Nabble.com.
16 years, 3 months