[rules-users] Another problem

Anstis, Michael (M.) manstis1 at ford.com
Wed Jul 18 10:06:41 EDT 2007


Hi Natraj,
 
In your particular case I think the problem is caused by a cross-product setting in Drools.
 
I think, in older versions two patterns using the same Object type, expect it to be the same (by reference) whereas in newer versions (by default) the objects are different.
 
I think there might be a setting to control this behaviour (in the older version). Edson, Mark - I can't remember the specifics. Any ideas to avoid a search of the newsgroup?
 
Lots of thinking!
 
With kind regards,
 
Mike


________________________________

	From: rules-users-bounces at lists.jboss.org [mailto:rules-users-bounces at lists.jboss.org] On Behalf Of Natraj Gudla
	Sent: 18 July 2007 14:54
	To: gs at gernotstarke.de; Rules Users List
	Subject: Re: [rules-users] Another problem
	
	
	Hi Starke,
	 
	Thanks a lot for your inputs. Apart from being able to debug using your stuff, my main concern is that a simple declaration is making the rule not to fire. Why is that so? 
	I am pretty sure, when i remove that particular line the fact which is passed passes the condition. 
	 
	The Drools documentation has a clear example which does the same. 
	 
	Any help in this regard will highly be appreciated.
	 
	Thanks
	Natraj
	
	 
	On 7/18/07, Dr. Gernot Starke <gs at gernotstarke.de> wrote: 

		Hi Natraj,
		
		I wrote up a few tactics to (successfully) debug rules:
		
		http://rbs.gernotstarke.de/faq/faq/faq-devel.html
		
		It's neither finished nor complete - but try it out...
		(test both conditions with one rule for each of them,
		test for the existence of the appropriate facts, 
		include a catchall-rule which prints all facts from wm.)
		
		regards,
		Gernot
		
		
		> Hi, I am using Drools 3.0.6, and facing a peculiar problem.
		>
		> My rule:
		>
		> *
		>
		> rule* "Calculate Business profit,1"* 
		> **salience* 1000
		>
		> *when
		>
		> **EMIAgainstProperty ( BP1 : refBP1 )
		> *emi : EMIAgainstProperty ( businessProfit2 > BP1 )
		>
		> *then* *
		> *System.out.println(" BP "+( emi.getBusinessProfit1
		> ()+emi.getBusinessProfit2())/2);*
		> *emi.setBusinessProfit((emi.getBusinessProfit1
		> ()+emi.getBusinessProfit2())/2);*
		> **end*
		>
		> **
		>
		> The above line in bold inside the condition part seem to create problem 
		> for
		> rule evaluation. WHen i have this, the rule does not show up in the Agenda
		> view, hence i dont see the console print in the action part. As soon as i
		> remove this line and replace BP1 with 1.5 in the second line, i see the
		> rule
		> being fired.
		>
		> As far as i understand, I am doing a declaration to set refBP1 an object
		> attribute to BP1, which i later use.What is that i am missing here? My 
		> fact
		> has proper getter and setters for refBP1 attribute.
		>
		>
		>
		> Thanks
		>
		> Natraj
		> _______________________________________________
		> rules-users mailing list 
		> rules-users at lists.jboss.org
		> https://lists.jboss.org/mailman/listinfo/rules-users
		> 
		
		
		--
		Dr. Gernot Starke
		Willi-Lauf Allee 43, D-50858 Köln
		Tel. +49 (0) 177 - 728 2570
		Mail: gs at gernotstarke.de
		http://www.gernotstarke.de 
		http://www.arc42.de
		_______________________________________________
		rules-users mailing list
		rules-users at lists.jboss.org
		https://lists.jboss.org/mailman/listinfo/rules-users
		


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20070718/b2a6078e/attachment.html 


More information about the rules-users mailing list