logo       

Sponsor
FREE Network Mapping Tool for Microsoft® Office Visio® Professional 2007
Don't map your network by hand - let LANsurveyor Exx press for Microsoft Visio Professional 2007 automatically create network diagrams for you!

[drools-interest] Drools--more than one parameter--URGENT pls: msg#00014

java.drools.user

Subject: [drools-interest] Drools--more than one parameter--URGENT pls

Hi,
I'm using Drools2-Beta11.
I've a requirement where in I want to pass 2 parameters and use one in
condition, and the other in consequence.

The rule is like this:

<rule name="675hyry_If">
<parameter identifier="DPObject">
<java:class type="DPObject"/>
</parameter>
<parameter identifier="TB">
<java:class type="TB"/>
</parameter>
<condition>

<java:condition>(DPObject.getRegime().equals(&quot;34&quot;))</java:condition>

</condition>
<consequence>
<java:consequence>
TB.setTotTax(100);
</java:consequence>
</consequence>
</rule>
I called the assertObject as workingMemory.assertObject(obj1);
//Here obj1 is the object of type DPObject.
But this is not working. The system giving the follwing error trace:


org.drools.spi.ConsequenceException: null : Sourced file: <Inline eval
of: tb.se
tTotTax(100); > : Attempt to invoke method: setTotTax() on undefined
variable or
class name: tb : Sourced file: <Inline eval of: tb.setTotTax(100); > :
Attempt
to invoke method: setTotTax() on undefined variable or class name: tb
at
org.drools.semantics.java.BlockConsequence.invoke(BlockConsequence.ja
va:141)
at org.drools.reteoo.impl.AgendaItem.fire(AgendaItem.java:139)
at
org.drools.reteoo.impl.AgendaImpl.fireNextItem(AgendaImpl.java:309)
at org.drools.WorkingMemory.fireAgenda(WorkingMemory.java:165)
at org.drools.WorkingMemory.assertObject(WorkingMemory.java:186)

at ExecutorFrame.executeRuleEngine(ExecutorFrame.java:244)
at ExecutorFrame.button1_ActionPerformed(ExecutorFrame.java:186)

at ExecutorFrame.access$100(ExecutorFrame.java:31)
at ExecutorFrame$2.actionPerformed(ExecutorFrame.java:123)
at java.awt.Button.processActionEvent(Button.java:382)
at java.awt.Button.processEvent(Button.java:350)
at java.awt.Component.dispatchEventImpl(Component.java:3615)
at java.awt.Component.dispatchEvent(Component.java:3477)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:456)
at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
read.java:201)
at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
ad.java:151)
at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)

at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)

at
java.awt.EventDispatchThread.run(EventDispatchThread.java:100)
Nested exception was:
Sourced file: <Inline eval of: tb.setTotTax(100); > : Attempt to invoke
method:
setTotTax() on undefined variable or class name: tb : at Line: 1 : in
file: <Inl
ine eval of: tb.setTotTax(100); > : tb .setTotTax ( 100 )
at bsh.Name.invokeMethod(Unknown Source)
at bsh.BSHMethodInvocation.eval(Unknown Source)
at bsh.BSHPrimaryExpression.eval(Unknown Source)
at bsh.Interpreter.eval(Unknown Source)
at bsh.Interpreter.eval(Unknown Source)
at org.drools.semantics.java.Interp.evaluate(Interp.java:124)
at
org.drools.semantics.java.BlockConsequence.invoke(BlockConsequence.ja
va:137)
at org.drools.reteoo.impl.AgendaItem.fire(AgendaItem.java:139)
at
org.drools.reteoo.impl.AgendaImpl.fireNextItem(AgendaImpl.java:309)
at org.drools.WorkingMemory.fireAgenda(WorkingMemory.java:165)
at org.drools.WorkingMemory.assertObject(WorkingMemory.java:186)

at ExecutorFrame.executeRuleEngine(ExecutorFrame.java:244)
at ExecutorFrame.button1_ActionPerformed(ExecutorFrame.java:186)

at ExecutorFrame.access$100(ExecutorFrame.java:31)
at ExecutorFrame$2.actionPerformed(ExecutorFrame.java:123)
at java.awt.Button.processActionEvent(Button.java:382)
at java.awt.Button.processEvent(Button.java:350)
at java.awt.Component.dispatchEventImpl(Component.java:3615)
at java.awt.Component.dispatchEvent(Component.java:3477)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:456)
at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
read.java:201)
at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
ad.java:151)
at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)

at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)

at
java.awt.EventDispatchThread.run(EventDispatchThread.java:100)


If anybody knows the answer, pls let me know.
Regards,
Padmaja

_______________________________________________
drools-interest mailing list
drools-interest@xxxxxxxxxxxxxxxxxx
http://lists.codehaus.org/mailman/listinfo/drools-interest

.






Only community members can participate in forum threads. You must Register or log in to contribute.

<Prev in Thread] Current Thread [Next in Thread>
Sponsor
FREE Network Mapping Tool for Microsoft® OfficeVisio Professional 2007
Don't map your network by hand - let LANsurveyor Express for Microsoft Visio Professional 2007
automatically create network diagrams for you!
Google Custom Search

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe

Navigation

Home | sitemap | advertise | OSDir is an inevitable website. super tiny logo