change of Rules Dyanmically
by saurabh maheshwari
HI ,
I want to change rules dynamically , but not want to retract the objects
from memory.
I am using one fact class which is also created dynamically.
is it possible to do this ?
Please help me.
Thanks ,
saurabh
13 years, 6 months
Distributed Knowledge Base
by Abhay B. Chaware
Using Drools Grid, is it possible to distribute rulebases based on category ? e.g. All computer related rules deployed on server A, all school related rules deployed on Server B and then based on which app you are coming from, just return a session handle from that particular server ? In other words, is it possible to load ( and evaluate ) rules based on category in Drools or Drools Grid ?
13 years, 6 months
Reusing rules outside a workflow
by Gerald Klopp
Hello,
- I have a set of rules attached to a workflow using the ruleflow-group
attribute.
I'd like to reuse these rules in another context outside the workflow.
What's the best solution to do this?
- I tried to use rules inheritance with the extends keywords but this
solution is not working as the RHS of the base rule is not executed.
More over, it is not very convenient as new rules have to be created and
maintained.
- Here is a very simple example to illustrate my problem:
I'd like to reuse this rule outside my workflow:
rule "firstNameIsEmpty"
ruleflow-group "validate-person"
when
Person(firstName == null || firstName == "")
then
System.out.println("ERROR : Empty first name");
end
One possible solution would be to create one base rule that could be reused
outside the workflow:
rule "firstNameIsEmpty"
when
Person(firstName == null || firstName == "")
then
System.out.println("ERROR : Empty first name");
end
and another rule for the workflow:
rule "firstNameIsEmptyInRuleFlowGroup" extends "firstNameIsEmpty"
ruleflow-group "validate-person"
when
then
end
But, in this case, the RHS of the base class (System.out) is not executed.
Is there another solution to solve this problem?
Thanks
--
View this message in context: http://drools.46999.n3.nabble.com/Reusing-rules-outside-a-workflow-tp2919...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 6 months
Expected relative performance of 5.2
by Nathan Bell
I have a general question about the expected performance of 5.2. In a
system with many facts and many rules what is the expected performance
of 5.2 compared to 5.1. In terms of speed is it expected to perform the
same, better, or worse? And in terms of memory usage is it expected to
be the same, better, or worse? I'm asking because I'm trying to decide
how quickly to switch to 5.2 when it is officially released. If there
are performance gains to be had I'll want to move to it more quickly.
Thanks,
Nathan Bell
13 years, 6 months
Re: [rules-users] DROOLS Negate Question
by mahmood lebbai
Thanks Michael for the immediate response.
Yes.The rule has been defined in guided web editor.
I had taken sample respoitory ( Pricing Loan guided web editor rules) and added the negate option in the row-1 of the rules and Validating the rules throws the error posted earlier.
Here is the source of the rule-1 ,
1. | #from row number: 1
2. | rule "Row 1 Pricing loans"
3. | dialect "mvel"
4. | when
5. | not (
6. | application : LoanApplication( amount > "131000" , amount <= "200000" , lengthYears == "30" , deposit < "20000" )
7. | income : IncomeSource( type == "Asset" )
8. | )
9. | then
10. | application.setApproved( true );
11. | application.setInsuranceCost( 0 );
12. | application.setApprovedRate( 2 );
13. | end
Regards,
Mahmood
From: mahmood lebbai <mahmoodlebbai(a)yahoo.com>
To: "rules-users(a)lists.jboss.org" <rules-users(a)lists.jboss.org>
Sent: Saturday, 21 May 2011 2:55 PM
Subject: DROOLS Negate Question
I need help to clarify the following
I had taken latest Guvnour 5.2.0 M2 version and use the sample pricing loan rules.
When i tried to use the "Negate" Meta data option and set it to true on first rule , i had got the following error.
Pricing loans] [ERR 102] Line 7:3 mismatched input 'income' in rule "Row 1 Pricing loans"
[Pricing loans] Line 16:0 unexpected exception at input 'rule'. Exception: java.util.EmptyStackException. Stack trace: java.util.EmptyStackException at java.util.Stack.peek(Stack.java:79) at java.util.Stack.pop(Stack.java:61) at org.drools.lang.ParserHelper.popParaphrases(ParserHelper.java:409) at org.drools.lang.ParserHelper.end(ParserHelper.java:723) at org.drools.lang.DRLParser.rule(DRLParser.java:915) at org.drools.lang.DRLParser.statement(DRLParser.java:248) at org.drools.lang.DRLParser.compilationUnit(DRLParser.java:143) at org.drools.compiler.DrlParser.compile(DrlParser.java:225) at org.drools.compiler.DrlParser.parse(DrlParser.java:71) at org.drools.compiler.DrlParser.parse(DrlParser.java:76) at
I have a similar requirement where in I need to write both negate with true and false within the same ruleset in guvnour. Please help me out how to achieve this.
Regards,
Mahmood
13 years, 6 months
Re: [rules-users] DROOLS Negate Question
by mahmood lebbai
Thanks Michael for the immediate response.
Yes.The rule has been defined in guided web editor.
I had taken sample respoitory ( Pricing Loan guided web editor rules) and added the negate option in the row-1 of the rules and Validating the rules throws the error posted earlier.
Here is the source of the rule-1 ,
1. | #from row number: 1
2. | rule "Row 1 Pricing loans"
3. | dialect "mvel"
4. | when
5. | not (
6. | application : LoanApplication( amount > "131000" , amount <= "200000" , lengthYears == "30" , deposit < "20000" )
7. | income : IncomeSource( type == "Asset" )
8. | )
9. | then
10. | application.setApproved( true );
11. | application.setInsuranceCost( 0 );
12. | application.setApprovedRate( 2 );
13. | end
Regards,
Mahmood
From: mahmood lebbai <mahmoodlebbai(a)yahoo.com>
To: "rules-users(a)lists.jboss.org" <rules-users(a)lists.jboss.org>
Sent: Saturday, 21 May 2011 2:55 PM
Subject: DROOLS Negate Question
I need help to clarify the following
I had taken latest Guvnour 5.2.0 M2 version and use the sample pricing loan rules.
When i tried to use the "Negate" Meta data option and set it to true on first rule , i had got the following error.
Pricing loans] [ERR 102] Line 7:3 mismatched input 'income' in rule "Row 1 Pricing loans"
[Pricing loans] Line 16:0 unexpected exception at input 'rule'. Exception: java.util.EmptyStackException. Stack trace: java.util.EmptyStackException at java.util.Stack.peek(Stack.java:79) at java.util.Stack.pop(Stack.java:61) at org.drools.lang.ParserHelper.popParaphrases(ParserHelper.java:409) at org.drools.lang.ParserHelper.end(ParserHelper.java:723) at org.drools.lang.DRLParser.rule(DRLParser.java:915) at org.drools.lang.DRLParser.statement(DRLParser.java:248) at org.drools.lang.DRLParser.compilationUnit(DRLParser.java:143) at org.drools.compiler.DrlParser.compile(DrlParser.java:225) at org.drools.compiler.DrlParser.parse(DrlParser.java:71) at org.drools.compiler.DrlParser.parse(DrlParser.java:76) at
I have a similar requirement where in I need to write both negate with true and false within the same ruleset in guvnour. Please help me out how to achieve this.
Regards,
Mahmood
13 years, 6 months