Skip to content

Commit

Permalink
JBRULES-3281 Drools Expert User Guide > The Basics, various edits
Browse files Browse the repository at this point in the history
  • Loading branch information
ge0ffrey committed Apr 3, 2012
1 parent 1dc0f77 commit 666de16
Showing 1 changed file with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,9 @@ end
<programlisting language="java">StatelessKnowledgeSession ksession = kbase.newStatelessKnowledgeSession();
Applicant applicant = new Applicant( "Mr John Smith", 16 );
Application application = new Application();
assertTrue( application() );
assertTrue( application.isValid() );
ksession.execute( Arrays.asList( new Object[] { application, applicant } ) );
assertFalse( application() );
assertFalse( application.isValid() );
</programlisting>

<para>The two execute methods <code>execute(Object object)</code> and
Expand Down Expand Up @@ -286,7 +286,7 @@ assertEquals( new Person( "Mr John Smith" ), results.getValue( "mrSmith" ) );
private String name
// getter and setter methods here
}
public classs Sprinkler {
public class Sprinkler {
private Room room;
private boolean on;
// getter and setter methods here
Expand All @@ -300,7 +300,7 @@ public class Alarm {
</programlisting>

<para>In the previous section on Stateless Sessions the concepts of
inserting and matching against data was introduced. That example assumed
inserting and matching against data were introduced. That example assumed
that only a single instance of each object type was ever inserted and thus
only used literal constraints. However, a house has many rooms, so rules
must express relationships between objects, such as a sprinkler being in a
Expand Down Expand Up @@ -411,7 +411,7 @@ end</programlisting>
kbuilder.add( ResourceFactory.newClassPathResource( "fireAlarm.drl", getClass() ),
ResourceType.DRL );
if ( kbuilder.hasErrors() ) {
System.err.println( builder.getErrors().toString() );
System.err.println( kbuilder.getErrors().toString() );
}
kbase.addKnowledgePackages( kbuilder.getKnowledgePackages() );
StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();</programlisting>
Expand All @@ -433,7 +433,7 @@ for( String name: names ){
ksession.insert( sprinkler );
}

ksession.fireAllRules()
ksession.fireAllRules();
</programlisting>

<programlisting>&gt; Everything is ok</programlisting>
Expand Down Expand Up @@ -467,9 +467,9 @@ ksession.retract( officeFireHandle );

ksession.fireAllRules();</programlisting>

<programlisting>&gt; Turn on the sprinkler for room office
&gt; Turn on the sprinkler for room kitchen
&gt; Cancel the alarm
<programlisting>&gt; Cancel the alarm
&gt; Turn off the sprinkler for room office
&gt; Turn off the sprinkler for room kitchen
&gt; Everything is ok</programlisting>

<para>Everyone still with me? That wasn't so hard and already I'm hoping
Expand Down

0 comments on commit 666de16

Please sign in to comment.