[rules-users] Guvnor Help !!

Michael Anstis michael.anstis at gmail.com
Thu Jun 28 05:12:22 EDT 2012


Hi,

You're basically right, but your terminology confused.

Firstly, I'd be surprised if the package in Guvnor would compile without
importing the POJO Model from the Global Area into package XYZ.

When attempting to compile package XYZ with rule "age and status" the
Classes used therein will not be found and hence compilation fail.

Secondly, the "Model" (whether POJO, as you are doing, or otherwise)
contains Classes. Not Objects. Nothing will fire even if everything else is
correct.

If you have not already done so, and I am beginning to feel you have not,
please read the Drools Expert user-guide. This explains how the Rule Engine
functions.

Thirdly, an example of where you might want to share a single POJO Model
between packages could be:-

Mortgage Model containing Classes for: Applicant, Property, MortgageOffer

Packages: org.yourco.mortgages.england.south,
org.yourco.mortgages.england.north, org.yourco.mortgages.england.west,
org.yourco.mortgages.england.east

With kind regards,

Mike

On 28 June 2012 09:49, abhinay_agarwal <abhinay_agarwal at infosys.com> wrote:

> hey mike,
>
> Rules are applied on the POJO models which we upload, nw if i upload a
> model
> in global area n write a rule based on it.
>
> Now, if i import the rule in any package, i would need the pojo model in
> the
> package..isn't it ?
>
> Because if i dont have data, then where m i supposed to apply rules on ??
>
> for example:
>
> I upload into global a jar og the following class
>
> public class person
> {
>      private int age;
>      private String status;
> // getters and setters;
> }
>
> i make a rule in global area:
>
> rule "age and status"
>   when
>         $p: Person(age>18)
>   then
>          $p.status="accepted"
> end
>
> Now i import the rule in package XYZ, bt ma package doesnt have the POJO
> model,
> now the rule in the package XYZ is a waste..ri8 ?? coz it will neva be
> fired..
>
> Can you give me an exmple where i would like to use a POJO model in two
> different packages!!!
>
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Guvnor-Help-tp4018290p4018311.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/20120628/5f610155/attachment.html 


More information about the rules-users mailing list