How to chose witch rules are going to be evaluated?
by mmarmol
Hi, I want to know how to avoid evaluation of some rules. I have tried to use
AgenGroups and FlowGroups but for what I have seen in my test rules are
always evaluated. I am using some cost demanding conditions in my "WHEN"
section of the rules and i would like to avoid rules that i know i dont need
based in the facts i will add to my session, any idea how I could do that?
The only thing i can think of is using separated Bases for the rules. I am
using 5.1.0M2 with StatefulKnowledgeSession.
Thanks!
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/How-to-chose-witch-ru...
Sent from the Drools - User mailing list archive at Nabble.com.
14 years, 5 months
Nested properties and memberOf
by Meeraj Kunnumpurath
Hi,
I have the following rules,
global java.util.Set accountNumbers;
rule "rule 1"
when
$d : Document()
$c : CreditTransferTransactionInformation (dbtrAcct == null ||
dbtrAcct.id == null || dbtrAcct.id.othr == null || dbtrAcct.id.othr.id ==
null) from $d.cstmrCdtTrfInitn.cdtTrfTxInf
$i : InternalInfo() from $c.internalInfo
then
$i.setStatus(PaymentStatus.INVALID);
$i.setErrorCode("PR002");
$i.setAdditionalInfo("Account number is null");
end
rule "rule 2"
when
$d : Document()
$c : CreditTransferTransactionInformation(internalInfo.status !=
PaymentStatus.INVALID && dbtrAcct.id.othr.id not memberOf accountNumbers)
from $d.cstmrCdtTrfInitn.cdtTrfTxInf
$i : InternalInfo() from $c.internalInfo
then
$i.setStatus(PaymentStatus.INVALID);
$i.setErrorCode("PR002");
$i.setAdditionalInfo("Account number not available in the routing
table");
end
My assumption is rule 1 and rule 2 will be executed in the order they
appear. Rule 1 checks all the nested attributes are not null and set the
status as invalid if any of them is null. Rule 2 uses the and operator and
checks the nested attribute is in the collection defined by the global, only
if the object is valid. I assume the LHS of rule 2 will be short circuited
if the object is invalid. However, if any of the nested property is null I
get the following exception from MVEL.
Caused by: [Error: unable to access property (null parent): id]
[Near : {... Unknown ....}]
^
[Line: 1, Column: 0]
at
org.mvel2.optimizers.impl.refl.ReflectiveAccessorOptimizer.getMethod(ReflectiveAccessorOptimizer.java:861)
Regards
Meeraj
14 years, 5 months
Question about Guvnor
by Patricia Bogoevici
Hi all,
My name is Patricia, and I am working on an enterprise app, that is using workflow and business rules (Drools). We need a way to allow the business users to modify the rules, and I started evaluating Drools Guvnor for whether it is good for our needs.
So far, it seems pretty ok, as it allows the end user to edit the rules, even for decision tables. I did not get too much into the details yet, but I noticed that searching rules/assets and sometimes even creating new rules is a bit slow. I do not have a lot of data, it is mostly the examples that Guvnor comes with plus some of my use cases. I am using the default set-up (JCR with local folder), and Tomcat 6.
Does any of you use Guvnor on production? If so, do you use JCR, or a DBMS? Did you run into any performance issues?
Thanks in advance.
P.S: I hope this is the right forum to ask this kind of questions.
--Patricia
14 years, 5 months
Issue when invoking rules present in Guvnor using AXIS webservice
by bbarani
Hi,
We are trying to create a drools Web service (using AXIS) and make it
interact with the rules present in Guvnor.
We tried implementing the logic to invoke the rule within the Skeleton and
tried invoking the same from a test client by passing the request
parameters, we are getting org.apache.axis2.AxisFault:
java.lang.NoClassDefFoundError: org/drools/WorkingMemory in the line of code
where the Guvnor working memory is being initiated in the skeleton, but we
have all the necessary libraries corresponding to drools/Guvnor present in
the class path.
So we tried another approach by importing the supporting classes as a one
Jar file into Guvnor and accessed the classes with in the jar and came up
with rules, while validating the rules we are getting binding error with the
classes added.
Has anyone faced this issue before?
Thanks,
Barani
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Issue-when-invoking-r...
Sent from the Drools - User mailing list archive at Nabble.com.
14 years, 5 months
Gunvor Rule Editor problem?
by Han Ming Low
I have downloaded Guvnor build 4122 from
http://hudson.jboss.org/hudson/job/drools/lastSuccessfulBuild/artifact/tr...
I'm using this version because of the BPMN editor provided.
However, the Guvnor Rule Editor is not behaving the same.
In the When condition, the action is greyed out and I cannot change the
properties of the action I have added.
A screenshot is upload to
http://img693.imageshack.us/img693/2567/guvnorq.jpg
I can't remember the all build number I have tried but 2 of them are build
4083 and 4097.
In some cases, the Rule Editor is working as I previously used it but upon
opening a model, it shows the screen same as 5.0 where a upload option is
available.
But, in some other build when the designer is loaded up nicely, the Rule
Editor did not behave the same way as it previously did.
If the Rule Editor has changed the way it works, please let me know how to
go about edition the "Set value of XXX" option.
Thanks.
Han Ming
14 years, 5 months
Lasse Wallentin is out of the office.
by Lasse.Wallentin@APCC.com
I will be out of the office starting 16-07-2010 and will not return until
09-08-2010.
I will respond to your message when I return.
14 years, 5 months
Avoiding loops
by Leonardo Gomes
Hi Droolers,
I'm trying to avoid loops and looking at different possibilities (no-loop,
activation-group, lock-on-active, etc.).
>Scenario I want to avoid:
For example, the initial facts trigger *rule 1*, which inserts new facts
that will trigger *rule 2*, which will then insert facts that would
re-trigger *rule 1*.
>Possibilities I tried:
no-loop -> just prevents the re-activation of the same rule
lock-on-active -> I can't know which rules should have lock-on-active set to
true, since I don't know what will be the initial facts.
>What I'm trying to achieve:
All rules in my rule set should execute only once. So, a rule inserts new
facts only rules that haven't executed so far, should be activated.
Is there a way to do that, let's say 'out-of-the-box', with DRL?
Thank you,
Leo.
14 years, 5 months
Globals in LHS
by Meeraj Kunnumpurath
Hi,
Can I use globals in the LHS of a rule. The rule I have is as follows,
package mypackage;
import mypackage.Payment;
global java.util.Set accountNumbers;
rule "Check debtor account number exists"
when
$p : Payment (accountNumber not memberOf $accountNumbers)
then
end
I insert an instance of HashSet using the setGlobal method on the
StatelessKnowledgeSession. However, when I execute the rule, I get the
following error.
[Error: unable to resolve method: mypackage.Payment.$accountNumbers()
[arglength=0]]
Kind regards
Meeraj
14 years, 5 months
Problem in Drools Flow
by santosh mukherjee
Hi,
How can I access the working memory of a process when inside a handler?? I
want to check if certain object is inside the working memory, then only the
process should exit from the workItem. Any idea on how this is to be done is
welcome?
Thanks
Santosh Mukherjee
14 years, 5 months