[rules-users] Dynamic Fact Types

jwillans2 james.willans at ceteva.com
Wed Feb 9 17:02:06 EST 2011


Hello,

I am looking for an approach to defining fact types
dynamically/programmatically.  Having hunted about, I can see a few ways of
achieving this.  My preferred approach to doing this would be Fact Templates
as described in the blog article here:

http://orangemile.blogspot.com/2008/07/drools-fact-template-example.html

I can see two problems with this approaches.  Firstly, it seems to be an
experimental feature and generally not supported.  Secondly, it only seems
to work with primitive fields (perhaps I'm wrong here?).  I get the
impression that the preferred option is to use Type Declarations.  In the
documentation for Type Declarations, it suggests that the rules evaluate
against an interface rather than an actual Java object and that the
interface can be implemented using different methods (POJO, reflection ..). 
Is there any examples or documentation on how to do this beyond generated
Java bean class? Just to be clear, I am looking to define the fact types
programmatic in a similar manner to that described in the above blog link,
and I am eager to avoid a compilation/class loader step.

Many thanks for any help that can be offered,

James
-- 
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Dynamic-Fact-Types-tp2462037p2462037.html
Sent from the Drools - User mailing list archive at Nabble.com.



More information about the rules-users mailing list