Can you share with us the Applicant class?
because if you have something like: boolean valid; it will be automatically
initialized to false, so the rule will not do anything just leave the
Applicant as it is
On Tue, Dec 24, 2013 at 10:05 AM, seyfullah <seyfullahtikic(a)outlook.com>wrote:
Hello,
I am trying to implement Driving License example application in Drools
Documentation Versio 6.0.0.0 Final.
My main method is as below.
KieServices kieServices = KieServices.Factory.get();
KieContainer kContainer =
kieServices.getKieClasspathContainer();
StatelessKieSession kSession =
kContainer.newStatelessKieSession();
Applicant applicant = new Applicant("Mr John Smith", 16);
assertTrue( applicant.isValid() );
kSession.execute( applicant ) ;
assertFalse ( applicant.isValid() );
My licenseApplication.drl file is as below:
package MyPackage
import MyPackage.Applicant;
rule "Is of valid age"
when
$a : Applicant( age < 18 )
then
$a.setValid ( false );
end
Thanks to assertTrue and asserFalse methods, its output is
It is false as not expected
It is false as expected
Bu when I change age parameter from 16 to 22 its output is same again. I
expected that it is true.
I think there is something wrong.
Do you have any idea about this problem?
Regards
--
View this message in context:
http://drools.46999.n3.nabble.com/Driving-License-application-tp4027403.html
Sent from the Drools: User forum mailing list archive at
Nabble.com.
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
--
- MyJourney @
http://salaboy.com <
http://salaboy.wordpress.com>
- Co-Founder @
http://www.jugargentina.org
- Co-Founder @
http://www.jbug.com.ar
- Salatino "Salaboy" Mauricio -