[rules-users] talking about new features...

Anstis, Michael (M.) manstis1 at ford.com
Thu Feb 22 12:13:31 EST 2007


Can this not be achieved by using a Map's entrySet property?
 
$o : MyMapSubClass( entrySet contains 'myName' );


________________________________

	From: rules-users-bounces at lists.jboss.org
[mailto:rules-users-bounces at lists.jboss.org] On Behalf Of Olenin,
Vladimir (MOH)
	Sent: 22 February 2007 16:17
	To: Rules Users List
	Subject: [rules-users] talking about new features...
	
	

	Hi,

	 

	Talking about new features to be included in the new release, I
think the most compelling might be the ability to use Maps as facts (ie,
from the point of view of a complete DROOLS newbie). Technically POJO is
a Map with some restricted functionality (can't count properties, check
for property existence, etc). Is it really a big change? The rule
formulation will remain the same from what I understand and the LHS like

	 

	            Map(name == 'myName')

	 

	Will simply mean any map object which has a key 'name' and value
for the key is 'myName'. The 'type matching' feature would be kind of
less useful in case Map fact is used, but this can probably solved
through introducing some default 'type' key which Map object should have
and in a very simplistic implementation just include 'type' as a
constraint.

	 

	Another alternative (which might probably be more 'backward
compatible' with existing implementation) is to dynamically generate
POJOs from Map definition. 'type' or 'class' key will correspond to a
full qualified class name, all other keys found in the map - POJOs
properties. Or 'type' can stay 'anonymous' - might be useful in some
cases as well....

	 

	The 'weakly defined' fact objects might be quite useful in some
cases, eg when rules 'cross cut' business domain. Kind of 'dynamic
rules' :-).

	 

	 

	Vlad

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


More information about the rules-users mailing list