[rules-users] Quick syntax question

Felipe Piccolini felipe.piccolini at bluesoft.cl
Thu Jul 26 15:34:59 EDT 2007


This works:

if your fact is:
cl = Class.forName("java.lang.String");

And the rule is:

rule "Test Class type"
	when
		$cl: Class(this == (String.class))
	then
		System.out.println("Test Class: OK");
end



On 26-07-2007, at 12:11, Eric Miles wrote:

> Eh, I need a marker fact that identifies if a certain rule needs to  
> be run.  So I'm inserting a java.lang.Class<T> object into the  
> session.  The T determines if a rule is activated.  Does that make  
> sense?
>
> On Thu, 2007-07-26 at 16:06 +0100, Anstis, Michael (M.) wrote:
>> Surely this LHS is matched by the pattern
>>
>> $sc : SomeClass()
>>
>> ???
>>
>> -----Original Message-----
>> From: rules-users-bounces at lists.jboss.org
>> [mailto:rules-users-bounces at lists.jboss.org] On Behalf Of Eric Miles
>> Sent: 26 July 2007 15:19
>> To: rules-users at lists.jboss.org
>> Subject: [rules-users] Quick syntax question
>>
>> Is there an easier way to write this LHS?
>>
>> Class(name == 'com.mycompany.SomeClass')
>>
>> It would be nice to do something like this:
>>
>> Class(name == SomeClass.class.getName())
>>
>> Suggestions?
>>
>> Thanks all!
>>
>> _______________________________________________
>> rules-users mailing list
>> rules-users at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/rules-users
>>
>> _______________________________________________
>> rules-users mailing list
>> rules-users at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/rules-users
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users


Felipe Piccolini M.
felipe.piccolini at bluesoft.cl




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


More information about the rules-users mailing list