<span class="gmail_quote"></span>
<div> </div>
<div>Hi Group Members,<br> <br>In Drools 4.0.5 release most of the bugs with <strong>"Working Memory serialization"</strong> are fixed. But still the feature has few bugs. <br> <br>The bug scenario :<br>1. Create a rule Base & Working Memory (Stateful Session).<br>
2. Assert some objects in Working Memory & call fireAll()<br>3. Serialize both Rule Base & Working Memory.<br>4. De Serialize Rule Base & Working Memory.<br>5. Remove Pkg/rule from Rule Base.<br>6. Serialize both Rule Base & Working Memory.<br>
7. De Serialize Rule Base & Working Memory. ---------><strong> In this step Working Memory De Serialization fails with java.lang.ClassNotFoundException.<br></strong>8. Assert some more objects in Working Memory & call fireAll()<br>
<br>I have tested the scenario using <strong>"MarshallingTest.java"</strong> from Drools Codebase. In the <strong>MarshallingTest.testSerializeAddRemove_NoClassDefFoundError()</strong> test case, <br>I have appended bellow mentioned code snippet at end:<br>
</div>
<div>
<p> ruleBase = (RuleBase) serializeIn( serializedRulebase );<br> session = ruleBase.newStatefulSession( new ByteArrayInputStream( serializedSession ) ); <strong>// throws java.lang.ClassNotFoundException Exception<br>
</strong> results = (List) session.getGlobal( "results" );<br> <br> InternalFactHandle stilton5 = (InternalFactHandle) session.insert( new Cheese( "stilton", 30 ) );<br> InternalFactHandle brie5 = (InternalFactHandle) session.insert( new Cheese( "brie", 30 ) );<br>
InternalFactHandle bob7 = (InternalFactHandle) session.insert( new Person( "bob", 30 ) );<br> InternalFactHandle bob8 = (InternalFactHandle) session.insert( new Person( "bob", 40 ) );<br>
session.fireAllRules();<br> <br> assertEquals( 8,<br> results.size() );<br> assertEquals( bob7.getObject(),<br> results.get( 6 ) );<br> assertEquals( bob8.getObject(),<br>
results.get( 7 ) );<br> <br> serializedSession = null;<br> serializedRulebase = null;<br> <br> serializedSession = serializeOut( session );<br> serializedRulebase = serializeOut( ruleBase );<br>
<br> session.dispose();<br> <br> <br><strong>One more bug is:</strong> Can not serialize Working Memory if Rule contains <strong>Accumulate</strong> or <strong>Collect</strong> Conditional element. Because, both of them have nested static class "<strong>AccumulateMemory</strong>" & "<strong>CollectMemory</strong>" respectively, which are not serializable.<br>
</p>
<p>We want to use Drools in our project with its <strong>"Working Memory serialization"</strong> feature to maintain state of Rule Engine between executions. So Fix of All bugs related to <strong>"Working Memory serialization"</strong> feature is very important for us. <br>
<br> <br>Thanks <br>Siddhartha<br></p></div><br clear="all">