[rules-users] Rule definition introspection

Mark Proctor mproctor at codehaus.org
Fri Feb 17 01:29:22 EST 2012


On 17/02/2012 05:37, GPatel at tsys.com wrote:
> I need it at rule definition time, or when the rule is saved. Could 
> you point me to a starting place in the internal api ?
take a look in drools-compiler and org.drools.lang.RuleParserTest.

Mark
>
> Thanks
> G. Patel
>
>
>
> From: Mark Proctor <mproctor at codehaus.org>
> To: rules-users at lists.jboss.org
> Date: 02/16/2012 10:06 PM
> Subject: Re: [rules-users] Rule definition introspection
> Sent by: rules-users-bounces at lists.jboss.org
> ------------------------------------------------------------------------
>
>
>
> On 17/02/2012 01:11, _GPatel at tsys.com_ <mailto:GPatel at tsys.com>wrote:
> Is it possible to self-introspect the rule definition?
>
> For example:
>
> when
>        $redCar : Car(color == 'red')
> then
>        System.out.println("a red car exists");
>
> Is it possible to know that the above rule uses the Car fact and the 
> Car.color attribute?
> Yes, but you'll need to dig into internal apis. If you are doing this 
> at runtime just start introspecting the rule object to get an idea of 
> all the internal data structures.
>
> Mark
>
> Thanks
> G. Patel----------------------------------------- The information 
> contained in this communication (including any attachments hereto) is 
> confidential and is intended solely for the personal and confidential 
> use of the individual or entity to whom it is addressed. If the reader 
> of this message is not the intended recipient or an agent responsible 
> for delivering it to the intended recipient, you are hereby notified 
> that you have received this communication in error and that any 
> review, dissemination, copying, or unauthorized use of this 
> information, or the taking of any action in reliance on the contents 
> of this information is strictly prohibited. If you have received this 
> communication in error, please notify us immediately by e-mail, and 
> delete the original message. Thank you
>
> _______________________________________________
> rules-users mailing list
> _rules-users at lists.jboss.org_ <mailto: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

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


More information about the rules-users mailing list