Uploaded image for project: 'JBRULES'
  1. JBRULES
  2. JBRULES-3281

Drools Expert User Guide > The Basics, various edits

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 5.4.0.CR1
    • 5.3.0.Final
    • drools-docs-expert
    • 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.)

      Attachments

        Activity

          People

            gdesmet@redhat.com Geoffrey De Smet (Inactive)
            dralt Dr Alt (Inactive)
            Archiver:
            rhn-support-ceverson Clark Everson

            Dates

              Created:
              Updated:
              Resolved:
              Archived:

              PagerDuty