[rules-users] How to write a rule that fires when it matches against specific facts in working memory.

groovenarula gnarula1 at la-z-boy.com
Wed Jan 26 23:59:21 EST 2011


Edson,

This surely looks like a great template to base my implementation - it looks like an great starting point.

Gurvinder



-----Original Message-----
From: Edson Tirelli-4 [via Drools - Java Rules Engine] [mailto:ml-node+2359987-1512063982-9505 at n3.nabble.com]
Sent: Wed 1/26/2011 11:44 PM
To: Gurvinder Narula1
Subject: Re: How to write a rule that fires when it matches against specific facts in working memory.
 

   I suggest you use this as a base for your implementation, as I think it will help you:

https://github.com/droolsjbpm/droolsjbpm/blob/master/drools-core/src/main/java/org/drools/base/accumulators/CollectSetAccumulateFunction.java

<https://github.com/droolsjbpm/droolsjbpm/blob/master/drools-core/src/main/java/org/drools/base/accumulators/CollectSetAccumulateFunction.java> Â Â  Edson


2011/1/26 groovenarula <[hidden email]>


	Thanks Wolfgang. I found it. I Work on it and let you'll know how it goes.
	
	Sent from my iPhone

	On Jan 27, 2011, at 1:08 AM, "Wolfgang Laun-2 [via Drools - Java Rules Engine]" <[hidden email] <http://user/SendEmail.jtp?type=node&node=2359225&i=0> > wrote:
	
	

		Accumulate functions are very well documented in the Expert manual. Look for a section titled "Accumulate Functions".
		
		You could also use accumulate with all the steps in inline code, which is documented in the preceding section.
		
		-W
		
		
		
		
		On 26 January 2011 16:50, groovenarula <[hidden email] <http://user/SendEmail.jtp?type=node&node=2356705&i=0&by-user=t> > wrote:
		


			Thanks for outlining the approach, Edson.
			
			Unfortunately, I'm a newbie using drools, so I just need some clarification
			on what you mean by 'matchAll is your own accumulate function with the
			semantics you described.' ? Do you mean that I have to create a 'custom'
			accumulate function ?
			
			Edson, if that's the case, then I'll try to search for example of creating a
			custom function. When I last searched, I did find an example on the
			Internet, however, I don't think I found details of how to make the function
			available to the rules engine (is it as simple as including the jar in the
			classpath or do I need to take addtional steps to use Matchall in drl ?)
			
			Can you please elaborate for the benefit of a noobie ?
			
			Thanks
			Gurvinder
			
			
			--
			View this message in context: <http://drools-java-rules-engine.46999.n3.nabble.com/How-to-write-a-rule-that-fires-when-it-matches-against-specific-facts-in-working-memory-tp2294599p2354793.html?by-user=t&by-user=t&by-user=t> http://drools-java-rules-engine.46999.n3.nabble.com/How-to-write-a-rule-that-fires-when-it-matches-against-specific-facts-in-working-memory-tp2294599p2354793.html <http://drools-java-rules-engine.46999.n3.nabble.com/How-to-write-a-rule-that-fires-when-it-matches-against-specific-facts-in-working-memory-tp2294599p2354793.html?by-user=t&by-user=t> 
			Sent from the Drools - User mailing list archive at Nabble.com.
			_______________________________________________
			rules-users mailing list
			
			[hidden email] <http://user/SendEmail.jtp?type=node&node=2356705&i=1&by-user=t> 

			<https://lists.jboss.org/mailman/listinfo/rules-users> https://lists.jboss.org/mailman/listinfo/rules-users
			
			


		_______________________________________________ 
		rules-users mailing list 
		[hidden email] <http://user/SendEmail.jtp?type=node&node=2356705&i=2&by-user=t>  
		
		<https://lists.jboss.org/mailman/listinfo/rules-users> https://lists.jboss.org/mailman/listinfo/rules-users
		
		
		
________________________________

		If you reply to this email, your message will be added to the discussion below:
		<http://drools-java-rules-engine.46999.n3.nabble.com/How-to-write-a-rule-that-fires-when-it-matches-against-specific-facts-in-working-memory-tp2294599p2356705.html?by-user=t&by-user=t> http://drools-java-rules-engine.46999.n3.nabble.com/How-to-write-a-rule-that-fires-when-it-matches-against-specific-facts-in-working-memory-tp2294599p2356705.html <http://drools-java-rules-engine.46999.n3.nabble.com/How-to-write-a-rule-that-fires-when-it-matches-against-specific-facts-in-working-memory-tp2294599p2356705.html?by-user=t&by-user=t>  


________________________________

	View this message in context: Re: How to write a rule that fires when it matches against specific facts in working memory. <http://drools-java-rules-engine.46999.n3.nabble.com/How-to-write-a-rule-that-fires-when-it-matches-against-specific-facts-in-working-memory-tp2294599p2359225.html?by-user=t> 

	Sent from the Drools - User mailing list archive <http://drools-java-rules-engine.46999.n3.nabble.com/Drools-User-f47000.html?by-user=t>  at Nabble.com.
	

	_______________________________________________
	rules-users mailing list
	[hidden email]
	https://lists.jboss.org/mailman/listinfo/rules-users
	
	




-- 
  Edson Tirelli
  JBoss Drools Core Development
  JBoss by Red Hat @ www.jboss.com


_______________________________________________ 
rules-users mailing list 
[hidden email] 
https://lists.jboss.org/mailman/listinfo/rules-users



________________________________

If you reply to this email, your message will be added to the discussion below:
http://drools-java-rules-engine.46999.n3.nabble.com/How-to-write-a-rule-that-fires-when-it-matches-against-specific-facts-in-working-memory-tp2294599p2359987.html 
To unsubscribe from How to write a rule that fires when it matches against specific facts in working memory., click here <http://drools-java-rules-engine.46999.n3.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=2294599&code=Z25hcnVsYTFAbGEtei1ib3kuY29tfDIyOTQ1OTl8MjAzMTM1NDY2Mw==> . 


-- 
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/How-to-write-a-rule-that-fires-when-it-matches-against-specific-facts-in-working-memory-tp2294599p2360052.html
Sent from the Drools - User mailing list archive at Nabble.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20110126/d4c2df84/attachment.html 


More information about the rules-users mailing list