Details
-
Bug
-
Resolution: Done
-
Major
-
5.3.0.Final
-
None
Description
Starting at http://docs.jboss.org/drools/release/5.3.0.Final/drools-expert-docs/html_single/index.html#d0e251
Stateless Knowledge Session
Application pseudo code is missing method names:
The following should read application.isValid() in both occurrences (assertTrue(..) and assertFalse(..)), instead of application()
StatelessKnowledgeSession ksession = kbase.newStatelessKnowledgeSession();
Applicant applicant = new Applicant( "Mr John Smith", 16 );
Application application = new Application();
assertTrue( application.isValid() );
ksession.execute( Arrays.asList( new Object[] { application, applicant } ) );
assertFalse( application.isValid() );
Stateful Knowledge Session
Example code shows "public classs Sprinkler" should be "public class Sprinkler".
The sentence after that, "the concepts of inserting and matching against data was introduced" should read "were"
The fire alarm sample Java code has errors. "builder.getErrors()" should be "kbuilder.getErrors()" and kbase should be initialized before kbase.addKnowledgePackages as:
KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase();
ksession.fireAllRules() requires a semi-colon.
After retracting the two fire facts, the output should be:
Cancel the alarm
Turn off the sprinkler for room office
Turn off the sprinkler for room kitchen
Everything is ok
(Eventually, I'll learn how to make these changes myself and request git pulls.)