[rules-users] Driving License application

seyfullah seyfullahtikic at outlook.com
Tue Dec 24 04:05:34 EST 2013


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.


More information about the rules-users mailing list