[rules-users] Instantiate fact class declared only in drl

Wolfgang Laun wolfgang.laun at gmail.com
Mon Jan 9 10:15:16 EST 2012


I've found that creating objects and facts from DRL-declared classes is
easily done in DRL, in RHS code.
-W

On 9 January 2012 16:06, MarcoMojana <marco.mojana at exmachina.ch> wrote:

> Hi,
> I have declared a fact in a drl file as follows:
>
> package a.b.c
> declare MyFact
>        vehicle : Vehicle
> end
>
> The corresponding class file doesn't exists: it is created on the fly by
> drools at runtime. The class name should be a.b.c.MyFact, but the
> classloader cannot find it by using:
> Class c = Class.forName("a.b.c.MyFact");
>
> Is it possible to do that and how? I don't want to create the class because
> it is used only by rules inside the drl file, but I would like to write a
> test case for them.
>
> Thank you
>
> --
> MM
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Instantiate-fact-class-declared-only-in-drl-tp3644780p3644780.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> _______________________________________________
> 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/20120109/af71afb1/attachment.html 


More information about the rules-users mailing list