Its interesting, Conways game of life was created to demonstrate a "determinisitc universe" - if you think as the little "critters" as life forms its pretty cool. A good example of how very very simple rules (and only a small number) can create complex behaviour.
<br><br><br><br><div><span class="gmail_quote">On 4/17/07, <b class="gmail_sendername">Mark Proctor</b> &lt;<a href="mailto:mproctor@redhat.com">mproctor@redhat.com</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I have just moved Jeff Brown&#39;s &quot;Conways Game of Life&quot; to a stateful<br>example, this is now the best place to look to understand jboss rules.<br>It&#39;s also good to compare this stateful implementation to the old
<br>stateless version. Trunk introduces a new feature to help deal with<br>recursion &quot;lock-on-active&quot; which stops a rule being able to create<br>activations while it&#39;s agenda-group/rule-flow-group has focus - so it&#39;s
<br>a much stronger no-loop. Probably the most important thing this example<br>shows is how to think relationally, the old example used nested<br>properties and sets to maintain the &quot;neighbour&quot; information; this
<br>example shows how to achieve the same but expressing it relationally,<br>using the Neighbor relation class, further it shows how we can exploit<br>the the cross-product relational information to drive the engine without
<br>us having to write loops. Currently the example is using agenda-groups<br>to drive execution flow, I&#39;m now in the process of moving this to<br>rule-flow-groups.<br><br>You&#39;ll need trunk to be able to run this, so checkout:
<br><a href="http://anonsvn.labs.jboss.com/labs/jbossrules/trunk/">http://anonsvn.labs.jboss.com/labs/jbossrules/trunk/</a><br>Make sure you have maven 2.0.6 installed and then type the following<br>from the root directory:
<br>mvn clean install -Declipse=true<br>The eclipse plugin will now be built in the drools-eclipse/target<br>directory, so open that up and unzip into your eclipse install (make<br>sure you use -clean to start eclipse). Then import drools-examples and
<br>&quot;run as application&quot; the ConwayGUI class.<br><br>I plan to do a blog or two on how this exampe works, and my next<br>challenge will be to migrate the pacman game to jboss rules.<br><br>Mark<br><br>--<br>Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod
<br>Street, Windsor, Berkshire,<br>SI4 1TE, United Kingdom.<br>Registered in UK and Wales under Company Registration No. 3798903<br>Directors: Michael Cunningham (USA), Charlie Peters (USA) and David<br>Owens (Ireland)<br>
<br><br><br>package org.drools.examples<br><br>import org.drools.examples.conway.Cell;<br>import org.drools.examples.conway.CellGrid;<br>import org.drools.examples.conway.Neighbor;<br>import org.drools.examples.conway.Phase
;<br>import org.drools.examples.conway.CellState;<br><br>import org.drools.WorkingMemory;<br>import org.drools.common.InternalWorkingMemoryActions;<br>import org.drools.RuleBase;<br><br><br>rule &quot;register north east&quot;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;agenda-group &quot;register neighbor&quot;<br>when<br>&nbsp;&nbsp;&nbsp;&nbsp;CellGrid( $numberOfColumns : numberOfColumns )<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$cell: Cell( $row : row &gt; 0, $col : col &lt; ( $numberOfColumns - 1 ) )<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$northEast : Cell( row&nbsp;&nbsp;== ($row - 1), col == $col )
<br>then<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;assert( new Neighbor( $cell, $northEast ) );<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;assert( new Neighbor( $northEast, $cell ) );<br>end<br><br>rule &quot;register north&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;agenda-group &quot;register neighbor&quot;<br>
when<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$cell: Cell( $row : row &gt; 0, $col : col )<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$north : Cell( row&nbsp;&nbsp;== ($row - 1), col == $col )<br>then<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;assert( new Neighbor( $cell, $north ) );<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;assert( new Neighbor( $north, $cell ) );
<br>end<br><br>rule &quot;register north west&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;agenda-group &quot;register neighbor&quot;<br>when<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$cell: Cell( $row : row &gt; 0, $col : col &gt; 0 )<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$northWest : Cell( row&nbsp;&nbsp;== ($row - 1), col == ( $col - 1 ) )
<br>then<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;assert( new Neighbor( $cell, $northWest ) );<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;assert( new Neighbor( $northWest, $cell ) );<br>end<br><br>rule &quot;register west&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;agenda-group &quot;register neighbor&quot;<br>
when<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$cell: Cell( $row : row &gt; 0, $col : col &gt; 0 )<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$west : Cell( row&nbsp;&nbsp;== $row, col == ( $col - 1 ) )<br>then<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;assert( new Neighbor( $cell, $west ) );<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;assert( new Neighbor( $west, $cell ) );
<br>end<br><br>rule &quot;Kill The Lonely&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;agenda-group &quot;evaluate&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;no-loop<br>when<br>#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; A live cell has fewer than 2 live neighbors<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;theCell: Cell(liveNeighbors &lt; 2, cellState == 
CellState.LIVE, phase == Phase.EVALUATE)<br>then<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;theCell.setPhase(Phase.KILL);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;modify( theCell );<br>end<br><br>rule &quot;Kill The Overcrowded&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;agenda-group &quot;evaluate&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;no-loop
<br>when<br>#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; A live cell has more than 3 live neighbors<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;theCell: Cell(liveNeighbors &gt; 3, cellState == CellState.LIVE, phase == Phase.EVALUATE)<br>then<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;theCell.setPhase(Phase.KILL);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;modify( theCell );
<br>end<br><br>rule &quot;Give Birth&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;agenda-group &quot;evaluate&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;no-loop<br>when<br>#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; A dead cell has 3 live neighbors<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;theCell: Cell(liveNeighbors == 3, cellState == CellState.DEAD
, phase == Phase.EVALUATE)<br>then<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;theCell.setPhase(Phase.BIRTH);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;modify( theCell );<br>end<br><br>rule &quot;reset calculate&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;agenda-group &quot;reset calculate&quot;<br>when<br>then
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;WorkingMemory wm = drools.getWorkingMemory();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;wm.getAgenda().clearAgendaGroup( &quot;calculate&quot; );<br>end<br><br>rule &quot;kill&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;agenda-group &quot;kill&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;no-loop
<br>when<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;theCell: Cell(phase == Phase.KILL)<br>then<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;theCell.setCellState(CellState.DEAD);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;theCell.setPhase(Phase.DONE);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;modify( theCell );<br>end<br><br>rule &quot;birth&quot;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;agenda-group &quot;birth&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;no-loop<br>when<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;theCell: Cell(phase == Phase.BIRTH)<br>then<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;theCell.setCellState(CellState.LIVE);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;theCell.setPhase(Phase.DONE);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;modify( theCell );
<br>end<br><br>rule &quot;Calculate Live&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;agenda-group &quot;calculate&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;lock-on-active<br>when<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;theCell: Cell(cellState == CellState.LIVE)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Neighbor(cell == theCell, $neighbor : neighbor)
<br>then<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$neighbor.setLiveNeighbors( $neighbor.getLiveNeighbors() + 1 );<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$neighbor.setPhase( Phase.EVALUATE );<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;modify( $neighbor );<br>end<br><br>rule &quot;Calculate Dead&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;agenda-group &quot;calculate&quot;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;lock-on-active<br>when<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;theCell: Cell(cellState == CellState.DEAD)<br>&nbsp;&nbsp;&nbsp;&nbsp;Neighbor(cell == theCell, $neighbor : neighbor )<br>then<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$neighbor.setLiveNeighbors( $neighbor.getLiveNeighbors() - 1 );
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$neighbor.setPhase( Phase.EVALUATE );<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;modify( $neighbor );<br>end<br><br>rule &quot;Kill All&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;agenda-group &quot;kill all&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;no-loop<br>when<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;theCell: Cell(cellState == 
CellState.LIVE)<br>then<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;theCell.setCellState(CellState.DEAD);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;modify( theCell );<br>end<br>package org.drools.examples.conway;<br><br>/**<br> * A &lt;code&gt;Cell&lt;/code&gt; represents a single cell within a &lt;code&gt;CellGrid&lt;/code&gt;.
<br> * A cell may be either live or dead. &lt;p/&gt;<br> *<br> * @author &lt;a href=&quot;mailto:<a href="mailto:brown_j@ociweb.com">brown_j@ociweb.com</a>&quot;&gt;Jeff Brown&lt;/a&gt;<br> * @see CellState<br> * @see CellGrid
<br> */<br>public class Cell {<br><br>&nbsp;&nbsp;&nbsp;&nbsp;private CellState cellState = CellState.DEAD;<br><br>&nbsp;&nbsp;&nbsp;&nbsp;private int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; phase&nbsp;&nbsp;&nbsp;&nbsp; = Phase.DONE;<br><br>&nbsp;&nbsp;&nbsp;&nbsp;private int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; liveNeighbors;<br><br>&nbsp;&nbsp;&nbsp;&nbsp;private int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; col;<br>
<br>&nbsp;&nbsp;&nbsp;&nbsp;private int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; row;<br><br>&nbsp;&nbsp;&nbsp;&nbsp;public Cell(int col,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;int row) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;this.col = col;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;this.row = row;<br>&nbsp;&nbsp;&nbsp;&nbsp;}<br><br>&nbsp;&nbsp;&nbsp;&nbsp;public int getCol() {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return col;<br>&nbsp;&nbsp;&nbsp;&nbsp;}<br>
<br>&nbsp;&nbsp;&nbsp;&nbsp;public int getRow() {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return row;<br>&nbsp;&nbsp;&nbsp;&nbsp;}<br><br>&nbsp;&nbsp;&nbsp;&nbsp;public int getPhase() {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return this.phase;<br>&nbsp;&nbsp;&nbsp;&nbsp;}<br><br>&nbsp;&nbsp;&nbsp;&nbsp;public void setPhase(int phase) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;this.phase = phase;<br>&nbsp;&nbsp;&nbsp;&nbsp;}<br>
<br>&nbsp;&nbsp;&nbsp;&nbsp;public int getLiveNeighbors() {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return this.liveNeighbors;<br>&nbsp;&nbsp;&nbsp;&nbsp;}<br><br>&nbsp;&nbsp;&nbsp;&nbsp;public void setLiveNeighbors(int liveNeighbors) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;this.liveNeighbors = liveNeighbors;<br>&nbsp;&nbsp;&nbsp;&nbsp;}<br><br>&nbsp;&nbsp;&nbsp;&nbsp;/**<br>
&nbsp;&nbsp;&nbsp;&nbsp; * @return this cell&#39;s current life state<br>&nbsp;&nbsp;&nbsp;&nbsp; * @see #queueNextCellState(org.drools.examples.conway.CellState)<br>&nbsp;&nbsp;&nbsp;&nbsp; * @see CellState<br>&nbsp;&nbsp;&nbsp;&nbsp; */<br>&nbsp;&nbsp;&nbsp;&nbsp;public CellState getCellState() {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return this.cellState
;<br>&nbsp;&nbsp;&nbsp;&nbsp;}<br><br>&nbsp;&nbsp;&nbsp;&nbsp;/**<br>&nbsp;&nbsp;&nbsp;&nbsp; * Sets this cells state<br>&nbsp;&nbsp;&nbsp;&nbsp; *<br>&nbsp;&nbsp;&nbsp;&nbsp; * @param newState<br>&nbsp;&nbsp;&nbsp;&nbsp; *&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;new state for this cell<br>&nbsp;&nbsp;&nbsp;&nbsp; * @see CellState<br>&nbsp;&nbsp;&nbsp;&nbsp; */<br>&nbsp;&nbsp;&nbsp;&nbsp;public void setCellState(final CellState newState) {
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;this.cellState = newState;<br>&nbsp;&nbsp;&nbsp;&nbsp;}<br><br>&nbsp;&nbsp;&nbsp;&nbsp;public String toString() {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return cellState + &quot; col=&quot; + this.col + &quot; row=&quot; + this.row + &quot; phase &#39;&quot; + phase + &quot;&#39; liveNeighbors &#39;&quot; + liveNeighbors + &quot;&#39;&quot;;
<br>&nbsp;&nbsp;&nbsp;&nbsp;}<br>}<br><br><br>package org.drools.examples.conway;<br><br>import org.drools.RuleBase;<br>import org.drools.WorkingMemory;<br>import org.drools.event.AgendaGroupPoppedEvent;<br>import org.drools.event.DefaultAgendaEventListener
;<br>import org.drools.examples.conway.patterns.ConwayPattern;<br><br>/**<br> * A &lt;code&gt;CellGrid&lt;/code&gt; represents a grid of &lt;code&gt;Cell&lt;/code&gt; objects.<br> * &lt;p/&gt;<br> *<br> * @author &lt;a href=&quot;mailto:
<a href="mailto:brown_j@ociweb.com">brown_j@ociweb.com</a>&quot;&gt;Jeff Brown&lt;/a&gt;<br> * @see Cell<br> */<br>public class CellGrid {<br><br>&nbsp;&nbsp;&nbsp;&nbsp;private final Cell[][] cells;<br><br>&nbsp;&nbsp;&nbsp;&nbsp;private WorkingMemory&nbsp;&nbsp;workingMemory;
<br><br>&nbsp;&nbsp;&nbsp;&nbsp;/**<br>&nbsp;&nbsp;&nbsp;&nbsp; * Constructs a CellGrid<br>&nbsp;&nbsp;&nbsp;&nbsp; *<br>&nbsp;&nbsp;&nbsp;&nbsp; * @param rows<br>&nbsp;&nbsp;&nbsp;&nbsp; *&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;number of rows in the grid<br>&nbsp;&nbsp;&nbsp;&nbsp; * @param columns<br>&nbsp;&nbsp;&nbsp;&nbsp; *&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;number of columns in the grid<br>&nbsp;&nbsp;&nbsp;&nbsp; */<br>&nbsp;&nbsp;&nbsp;&nbsp;public CellGrid(final int rows,
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;final int columns) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;this.cells = new Cell[rows][columns];<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;final RuleBase ruleBase = ConwayRuleBaseFactory.getRuleBase();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;this.workingMemory = ruleBase.newWorkingMemory
();<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DefaultAgendaEventListener listener = new DefaultAgendaEventListener() {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;public void agendaGroupPopped(AgendaGroupPoppedEvent event,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;WorkingMemory workingMemory) {
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.out.println( &quot;popped AgendaGroup = &#39;&quot; + event.getAgendaGroup().getName() + &quot;&#39;&quot; );<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.out.println( CellGrid.this.toString() );<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
System.out.println( &quot;&quot; );<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;};<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;this.workingMemory.addEventListener( listener );<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;this.workingMemory.assertObject( this );<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// populate the array of Cells and hook each
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// cell up with its neighbors...<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for ( int row = 0; row &lt; rows; row++ ) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for ( int column = 0; column &lt; columns; column++ ) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;final Cell newCell = new Cell( column,
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; row );<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;this.cells[row][column] = newCell;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;this.workingMemory.assertObject( newCell );<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;this.workingMemory.setFocus
( &quot;register neighbor&quot; );<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;this.workingMemory.fireAllRules();<br>&nbsp;&nbsp;&nbsp;&nbsp;}<br><br>&nbsp;&nbsp;&nbsp;&nbsp;/**<br>&nbsp;&nbsp;&nbsp;&nbsp; * @param row<br>&nbsp;&nbsp;&nbsp;&nbsp; *&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;row of the requested cell<br>&nbsp;&nbsp;&nbsp;&nbsp; * @param column<br>&nbsp;&nbsp;&nbsp;&nbsp; *&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;column of the requested cell
<br>&nbsp;&nbsp;&nbsp;&nbsp; * @return the cell at the specified coordinates<br>&nbsp;&nbsp;&nbsp;&nbsp; * @see Cell<br>&nbsp;&nbsp;&nbsp;&nbsp; */<br>&nbsp;&nbsp;&nbsp;&nbsp;public Cell getCellAt(final int row,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;final int column) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return this.cells[row][column];
<br>&nbsp;&nbsp;&nbsp;&nbsp;}<br><br>&nbsp;&nbsp;&nbsp;&nbsp;/**<br>&nbsp;&nbsp;&nbsp;&nbsp; * @return the number of rows in this grid<br>&nbsp;&nbsp;&nbsp;&nbsp; * @see #getNumberOfColumns()<br>&nbsp;&nbsp;&nbsp;&nbsp; */<br>&nbsp;&nbsp;&nbsp;&nbsp;public int getNumberOfRows() {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return this.cells.length;<br>&nbsp;&nbsp;&nbsp;&nbsp;}<br><br>&nbsp;&nbsp;&nbsp;&nbsp;/**
<br>&nbsp;&nbsp;&nbsp;&nbsp; * @return the number of columns in this grid<br>&nbsp;&nbsp;&nbsp;&nbsp; * @see #getNumberOfRows()<br>&nbsp;&nbsp;&nbsp;&nbsp; */<br>&nbsp;&nbsp;&nbsp;&nbsp;public int getNumberOfColumns() {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return this.cells[0].length;<br>&nbsp;&nbsp;&nbsp;&nbsp;}<br><br>&nbsp;&nbsp;&nbsp;&nbsp;/**<br>&nbsp;&nbsp;&nbsp;&nbsp; * Moves this grid to its next generation
<br>&nbsp;&nbsp;&nbsp;&nbsp; *<br>&nbsp;&nbsp;&nbsp;&nbsp; * @return &lt;code&gt;true&lt;/code&gt; if the state changed, otherwise false<br>&nbsp;&nbsp;&nbsp;&nbsp; * @see #transitionState()<br>&nbsp;&nbsp;&nbsp;&nbsp; */<br>&nbsp;&nbsp;&nbsp;&nbsp;public boolean nextGeneration() {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.out.println( &quot;next generation&quot; );
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;workingMemory.setFocus( &quot;calculate&quot; );<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;workingMemory.setFocus( &quot;kill&quot; );<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;workingMemory.setFocus( &quot;birth&quot; );<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;workingMemory.setFocus( &quot;reset calculate&quot; );
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;workingMemory.setFocus( &quot;rest&quot; );<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;workingMemory.setFocus( &quot;evaluate&quot; );<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;workingMemory.fireAllRules();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return workingMemory.getAgenda().getAgendaGroup( &quot;evaluate&quot; ).size() != 0;
<br>&nbsp;&nbsp;&nbsp;&nbsp;}<br><br>&nbsp;&nbsp;&nbsp;&nbsp;/**<br>&nbsp;&nbsp;&nbsp;&nbsp; * kills all cells in the grid<br>&nbsp;&nbsp;&nbsp;&nbsp; */<br>&nbsp;&nbsp;&nbsp;&nbsp;public void killAll() {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;this.workingMemory.setFocus( &quot;calculate&quot; );<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;this.workingMemory.setFocus( &quot;kill all&quot; );
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;this.workingMemory.setFocus( &quot;reset calculate&quot; );<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;this.workingMemory.fireAllRules();<br>&nbsp;&nbsp;&nbsp;&nbsp;}<br><br>&nbsp;&nbsp;&nbsp;&nbsp;/**<br>&nbsp;&nbsp;&nbsp;&nbsp; * Populates the grid with a &lt;code&gt;ConwayPattern&lt;/code&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp; *
<br>&nbsp;&nbsp;&nbsp;&nbsp; * @param pattern<br>&nbsp;&nbsp;&nbsp;&nbsp; *&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pattern to populate the grid with<br>&nbsp;&nbsp;&nbsp;&nbsp; * @see ConwayPattern<br>&nbsp;&nbsp;&nbsp;&nbsp; */<br>&nbsp;&nbsp;&nbsp;&nbsp;public void setPattern(final ConwayPattern pattern) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;final boolean[][] gridData = 
pattern.getPattern();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;int gridWidth = gridData[0].length;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;int gridHeight = gridData.length;<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;int columnOffset = 0;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;int rowOffset = 0;<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if ( gridWidth &gt; getNumberOfColumns() ) {
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;gridWidth = getNumberOfColumns();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;} else {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;columnOffset = (getNumberOfColumns() - gridWidth) / 2;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if ( gridHeight &gt; getNumberOfRows() ) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;gridHeight = getNumberOfRows();
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;} else {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;rowOffset = (getNumberOfRows() - gridHeight) / 2;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;killAll();<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for ( int column = 0; column &lt; gridWidth; column++ ) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for ( int row = 0; row &lt; gridHeight; row++ ) {
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if ( gridData[row][column] ) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;final Cell cell = getCellAt( row + rowOffset,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; column + columnOffset );<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cell.setCellState
( CellState.LIVE );<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;this.workingMemory.modifyObject( this.workingMemory.getFactHandle( cell ),<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cell );<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;workingMemory.setFocus( &quot;calculate&quot; );<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;workingMemory.fireAllRules();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.out.println( &quot;&quot; );<br>&nbsp;&nbsp;&nbsp;&nbsp;}<br><br>&nbsp;&nbsp;&nbsp;&nbsp;public String toString() {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;StringBuffer buf = new StringBuffer();
<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for ( int i = 0; i &lt; this.cells.length; i++ ) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for ( int j = 0; j &lt; this.cells[i].length; j++ ) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Cell cell = this.cells[i][j];<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.out.print( 
cell.getLiveNeighbors() + ((cell.getCellState() == CellState.DEAD) ? &quot;D&quot; : &quot;L&quot;) + &quot; &quot; );<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.out.println( &quot;&quot; );<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return 
buf.toString();<br>&nbsp;&nbsp;&nbsp;&nbsp;}<br>}<br><br><br>package org.drools.examples.conway;<br><br>public class Neighbor {<br>&nbsp;&nbsp;&nbsp;&nbsp;private Cell cell;<br>&nbsp;&nbsp;&nbsp;&nbsp;private Cell neighbor;<br><br>&nbsp;&nbsp;&nbsp;&nbsp;public Neighbor(Cell cell, Cell neighbor) {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;this.cell = cell;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;this.neighbor = neighbor;<br>&nbsp;&nbsp;&nbsp;&nbsp;}<br><br>&nbsp;&nbsp;&nbsp;&nbsp;public Cell getCell() {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return cell;<br>&nbsp;&nbsp;&nbsp;&nbsp;}<br><br>&nbsp;&nbsp;&nbsp;&nbsp;public Cell getNeighbor() {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return neighbor;<br>&nbsp;&nbsp;&nbsp;&nbsp;}<br><br>
&nbsp;&nbsp;&nbsp;&nbsp;public String toString() {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return &quot;cell &#39;&quot;+ this.cell + &quot;&#39; neighbour &#39;&quot; + this.neighbor + &quot;&#39;&quot;;<br>&nbsp;&nbsp;&nbsp;&nbsp;}<br><br>}<br><br><br>_______________________________________________
<br>rules-users mailing list<br><a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br><a href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users
</a><br><br></blockquote></div><br>