update Fact on BRMS bad restriction. Please change.
by Felipe Piccolini
Using the GUI editor for rules is a nice way to make rules, however
the editor put restrictions on what u can fill on the textfields
for a type of attribute, ie. if I have a Double attribute
(approvedMount) in a bean (Person) I cant make the update of this
field based on
another field ... what I wanna do (and cant on BRMS GUI) is:
rule "Set approvedMount for a women"
no-loop true
when
$p: Person($sex: sex == "F", $income: incomeMount)
then
$p.setApprovedMount($income * 1.2);
update($p);
end
Where my Person class has incomeMount and approvedMount as Double.
BRMS GUI only let me put 1.2 but no words to refer the $income variable.
What can I do?... where will be this possible?... it is quite useless
if I cant do what I want, because it force me to rebuild the bean
to have fields names like "approvedMountIncresedBasedOnIncome" and
make a formula inside the setter, which is exactly the code
I wanna put on rules, because is the bussines logic.
Felipe Piccolini M.
felipe.piccolini(a)bluesoft.cl
17 years, 1 month
FW: Help me
by Anstis, Michael (M.)
It looks like you are incorrectly using globals.
You need to insert a new fact into the working memory for
LoanApplicationBean (you currently add an instance as a global -
Final.main).
Your rule should also work on Facts and not globals (which should be
reserved for RHS function); for example:-
rule "go, go gadget validator"
when
$l : LoadApplicationBean( fullName == "" )
then
myGlobal.log("An inappropriate name");
end
All of which is in the documetation and examples.
I have not tried your code as I am at work...
_____
From: prateek.katiyar(a)wipro.com [mailto:prateek.katiyar@wipro.com]
Sent: 03 October 2007 10:57
To: Anstis, Michael (M.)
Subject: Re:Help me
Hi
Thanks for your reply.
I have three rules in my rule file.I want that when i run my first java
program,out of those three rules only first two rules should be validated
and when i run a other java program the only third rule should be validated.
For this i put my first two rules in one agenda group and i put the third
rule in another agenda group.
Now when i run my first java program then instead of validating only the
first two rules,the third rule is also validating and giving ma a exception
as:
org.drools.RuntimeDroolsException: java.lang.NullPointerException
at org.drools.rule.EvalCondition.isAllowed(EvalCondition.java:75)
at
org.drools.reteoo.EvalConditionNode.assertTuple(EvalConditionNode.java:141)
at
org.drools.reteoo.CompositeTupleSinkAdapter.createAndPropagateAssertTuple(Co
mpositeTupleSinkAdapter.java:73)
at
org.drools.reteoo.LeftInputAdapterNode.assertObject(LeftInputAdapterNode.jav
a:131)
at
org.drools.reteoo.SingleObjectSinkAdapter.propagateAssertObject(SingleObject
SinkAdapter.java:20)
at org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:168)
at org.drools.reteoo.Rete.assertObject(Rete.java:168)
at org.drools.reteoo.ReteooRuleBase.assertObject(ReteooRuleBase.java:190)
at
org.drools.reteoo.ReteooWorkingMemory$WorkingMemoryReteAssertAction.execute(
ReteooWorkingMemory.java:163)
at
org.drools.common.AbstractWorkingMemory.executeQueuedActions(AbstractWorking
Memory.java:1241)
at
org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.j
ava:421)
at
org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.j
ava:392)
at com.wipro.rfq.report.bean.Validator.main(Validator.java:87)
Caused by: java.lang.NullPointerException
at rules.Rule_validate_FullName_0.eval0(Rule_validate_FullName_0.java:9)
at
rules.Rule_validate_FullName_0Eval0Invoker.evaluate(Rule_validate_FullName_0
Eval0Invoker.java:16)
at org.drools.rule.EvalCondition.isAllowed(EvalCondition.java:71)
... 12 more
i am attaching my all three programs with this mail.
Now give me some idea that how can i achieve my requirements?
With Regards
Prateek Katiyar
The information contained in this electronic message and any attachments to
this message are intended for the exclusive use of the addressee(s) and may
contain proprietary, confidential or privileged information. If you are not
the intended recipient, you should not disseminate, distribute or copy this
e-mail. Please notify the sender immediately and destroy all copies of this
message and any attachments.
WARNING: Computer viruses can be transmitted via email. The recipient should
check this email and any attachments for the presence of viruses. The
company accepts no liability for any damage caused by any virus transmitted
by this email.
www.wipro.com
17 years, 1 month
Help me
by prateek.katiyar@wipro.com
Hi
I hava a rule file as:
<?xml version="1.0" encoding="UTF-8"?>
<package name="rules"
xmlns="http://drools.org/drools-4.0"
xmlns:xs="http://www.w3.org/2001/XMLSchema-instance"
xs:schemaLocation="http://drools.org/drools-4.0 drools-4.0.xsd">
<import name="com.wipro.rfq.report.bean.Validator.RFQBean" />
<global identifier="rfq" type="com.wipro.rfq.report.bean.Validator.RFQBean" />
<import name="com.wipro.loan.validation.bean.Final.LoanApplicationBean" />
<global identifier="loanApplication" type="com.wipro.loan.validation.bean.Final.LoanApplicationBean" />
<rule name="Check_NotNullof_rfqId">
<rule-attribute name="agenda-group" value="Check"/>
<rule-attribute name="auto-focus" value="true"/>
<lhs>
<eval>(rfq.getM_rfqId() ==null) || (rfq.getM_rfqId().trim().equals(""))</eval>
</lhs>
<rhs>
System.out.println("The value of m_rfqId is null.");
</rhs>
</rule>
<rule name="Check_NotNullof_partId">
<rule-attribute name="agenda-group" value="Check"/>
<rule-attribute name="auto-focus" value="true"/>
<lhs>
<eval>(rfq.getM_partId() =="null") || (rfq.getM_partId().trim().equals(""))</eval>
</lhs>
<rhs>
System.out.println("The value of m_partId is null.");
</rhs>
</rule>
<rule name="validate_FullName">
<rule-attribute name="agenda-group" value="validate-bean"/>
<rule-attribute name="auto-focus" value="true"/>
<lhs>
<eval>true</eval>
</lhs>
<rhs>
System.out.println("full name is null from xml");
</rhs>
</rule>
</package>
As for the first two rules i declared the agenda group as "Check".
Now i want to know that how will i write the code in my java program to activate this agenda group instead of "MAIN".
I have already tried with the following option:
Agenda agenda=workingMemory.getAgenda();
AgendaGroup Check=agenda.getAgendaGroup("Check");
workingMemory.setFocus(Check);
workingMemory.fireAllRules();
But after this when i wrote System.out.println("The focussed agenda group is "+workingMemory.getFocus());
Then the output was The focussed agenda group is AgendaGroup 'MAIN'
So now could you please help me.
With Regards
Prateek
The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments.
WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.
www.wipro.com
17 years, 1 month
Package.clear() doesn't clear RuleFlows
by ekke
there's no comment in JavaDoc, but I think a clear() on a Package
should clear all Rules and all RuleFlows.
but: after clear() the Rules went away, but the RuleFlows are still there.
I tested the behaviour with
....getPackage().getRules().length;
....getPackage().getRuleFlows().size();
getRules().length was Zero as expected
getRuleFlows().size() was 1 as before the clean
then I tried
.....removeRuleFlow("myID");
but its still there.
should I open a JIRA ?
ekke
--
View this message in context: http://www.nabble.com/Package.clear%28%29-doesn%27t-clear-RuleFlows-tf452...
Sent from the drools - user mailing list archive at Nabble.com.
17 years, 1 month
rule definition string
by Karl Trout
Anyone have a good idea on how one would go about inserting a definition of
the rule inside the rule so when the rule is analyzed the definition could
be attained?
17 years, 1 month
Can rules run on embedded system
by Joshua Jackson
Dear all,
I don't whether this question is valid or not. I am planning to write
a thesis about aritificial intelligence where the program will be
embedded in a hardware. I know that Java is able to run on an embedded
system, but is rules able to run on an embedded system?
Thanks in advance.
--
It's not just about coding, it's a matter of fulfilling your core being
YM!: thejavafreak
Blog: http://joshuajava.wordpress.com/
17 years, 1 month
Re: [rules-users] how to specify classpath dependencies in .drl files.
by Mark Proctor
Godmar Back wrote:
> I agree that it may not belong into the .drl file, though loading
> bytecode through the classloader via getResourceAsStream() also seems
> a rather ad-hoc solution.
>
>
I've already told you, that you are mistaken here. You do not need to
keep bytecode hanging around, and available via getResourceAsStream()
for any compilation to work. I can generate a class at runtime, in
memory, add it to a classloader and have the engine compile against it
without getResourceAsStream() being able to search for and return the
.class' bytecode.
> Some module system that allows the bundling of class and rules into
> modules, and the specification of dependencies between them, is
> clearly needed.
>
>
Yes in the rule agent and the deployment configuration properties system.
> - Godmar
>
> On 9/26/07, Mark Proctor <mproctor(a)codehaus.org> wrote:
>
>> Godmar Back wrote:
>> On 9/26/07, Mark Proctor <mproctor(a)codehaus.org> wrote:
>>
>>
>> Simple add the class at runtime to a classloader and use that classloader
>> as
>> the root classloader of the packagebuilder.
>>
>>
>> This would work if the class loader I provide implements
>> getResourceAsStream to match its behavior in loadClass (which most
>> class loaders do) - so you are correct here.
>>
>> The problem, however, is that I don't know which .jar files to include
>> in that class loader's path, *unless* I keep track of these .jar files
>> elsewhere - say in a configuration file, as a command line switch, or
>> by hardwiring it in my code.
>>
>> My proposal is to allow the user to specify the location of these jar
>> files in the .drl file, which a special classloader would then
>> automatically include as it encounters this declaration in the .drl
>> file.
>>
>> - Godmar
>>
>>
>> I don't think DRL files should be hard coded to Jars, I would rather see
>> this configuration else where. What you are talking about is deployment
>> configuraiotn issus, which is a difference concern and belongs in something
>> more like the RuleAgent. I beleve there are already plans to allow the
>> RuleAgent to specify locations to lookup classes at runtime.
>>
>> Mark
>>
>>
>
>
17 years, 1 month
Re: [drools-user] 4.0.2
by Brian Enderle
Has this been released? I looked on the Download page today and only 4.0.1
from Aug 30th is available. Is it only available thru SVN?
Thanks,
Brian Enderle
17 years, 2 months
RE: [rules-users] Pattern matching question
by Drouin.Mathieu
I'm using 4.0.1 and the insurance examples use binded variables only in
the DRL authored rules.
There are no binded variables with the rules that were authored using
the Guided Editor.
Mat
-----Original Message-----
From: rules-users-bounces(a)lists.jboss.org
[mailto:rules-users-bounces@lists.jboss.org] On Behalf Of Edson Tirelli
Sent: October 2, 2007 12:52 PM
To: Rules Users List
Subject: Re: [rules-users] Pattern matching question
This is available in BRMS 4.0. There are multiple samples in
there, some using DSL and some using the guided editor.
[]s
Edson
2007/10/2, Drouin.Mathieu < Mathieu.Drouin(a)cic.gc.ca
<mailto:Mathieu.Drouin@cic.gc.ca> >:
In the guide provided here:
https://hudson.jboss.org/hudson/job/drools/lastSuccessfulBuild/artifact/
trunk/target/docs/html/ch10.html
<https://hudson.jboss.org/hudson/job/drools/lastSuccessfulBuild/artifact
/trunk/target/docs/html/ch10.html>
Section: 10.1.14.1. BRMS editors
They show the example with binded variables....are these
features that are going to be in 4.0.2....or is it all done via DSL?
Thanks,
Mat
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
--
Edson Tirelli
Software Engineer - JBoss Rules Core Developer
Office: +55 11 3529-6000
Mobile: +55 11 9287-5646
JBoss, a division of Red Hat @ www.jboss.com
17 years, 2 months