[rules-users] FW: Help me

Anstis, Michael (M.) manstis1 at ford.com
Wed Oct 3 06:56:00 EDT 2007


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 at wipro.com [mailto:prateek.katiyar at 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
	

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20071003/c8c1c29d/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: allprograms.zip
Type: application/x-zip-compressed
Size: 5057 bytes
Desc: not available
Url : http://lists.jboss.org/pipermail/rules-users/attachments/20071003/c8c1c29d/attachment.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 4159 bytes
Desc: not available
Url : http://lists.jboss.org/pipermail/rules-users/attachments/20071003/c8c1c29d/attachment-0001.bin 


More information about the rules-users mailing list