<div dir="ltr">In case you need more working memories you could do snapshots - <a href="http://blog.athico.com/2008/05/efficient-binary-protocol-marshalling.html">http://blog.athico.com/2008/05/efficient-binary-protocol-marshalling.html</a><div>
<br></div><div>Regards,</div><div>Michal<br><br><div class="gmail_quote">On Thu, Oct 9, 2008 at 10:32 PM, Evans, Jess <span dir="ltr"><<a href="mailto:JEvans@collegeboard.org">JEvans@collegeboard.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div lang="EN-US" vlink="purple" link="blue">
<div dir="ltr" align="left"><span><font face="Arial" color="#0000ff" size="2">Thanks for the confirmation. I think it should be
straightforward to implement a parser as you suggest to populate
a list of java beans and assert them to the working memory. I'm just
surprised that this doesn't already exist.</font></span></div>
<div dir="ltr" align="left"><span><font face="Arial" color="#0000ff" size="2"></font></span> </div>
<div dir="ltr" align="left"><span><font face="Arial" color="#0000ff" size="2">May I ask how you manage the working memory? It looks
like you can't clone or snapshot a working memory. So, you must
either assert all the default facts in a new working memory for every user
session/request or use a shared synchronized working memory. I'm building
a web based wizard calculator with around 10k default immutable facts.
It's taking almost 800ms to assert and fire to reach an initial state, so I'm
planning on sharing one synchronized session. Is this a reasonable
approach or am I off my rocker?</font></span></div>
<div dir="ltr" align="left"><span><font face="Arial" color="#0000ff" size="2"></font></span> </div>
<div dir="ltr" align="left"><span><font face="Arial" color="#0000ff" size="2">Cheers,</font></span></div>
<div dir="ltr" align="left"><span><font face="Arial" color="#0000ff" size="2"></font></span> </div>
<div dir="ltr" align="left"><span><font face="Arial" color="#0000ff" size="2">-Jess</font></span></div><br>
<div lang="en-us" dir="ltr" align="left">
<hr>
<font face="Tahoma" size="2"><b>From:</b> <a href="mailto:rules-users-bounces@lists.jboss.org" target="_blank">rules-users-bounces@lists.jboss.org</a>
[mailto:<a href="mailto:rules-users-bounces@lists.jboss.org" target="_blank">rules-users-bounces@lists.jboss.org</a>] <b>On Behalf Of </b>Vikrant
Yagnick<br><b>Sent:</b> Thursday, October 09, 2008 2:45 PM<br><b>To:</b> Rules
Users List<br><b>Subject:</b> [rules-users] RE: fact base
storage?<br></font><br></div>
<div></div>
<div>
<p><span style="font-size:11pt;color:#1f497d">Hi
Jess,</span></p>
<p><span style="font-size:11pt;color:#1f497d"> </span></p>
<p><span style="font-size:11pt;color:#1f497d">I
am facing the same problem right now. While, I do not know of any OOTB ways to
do this, I initially implemented an all rule solution.</span></p>
<p><span style="font-size:11pt;color:#1f497d">In
my case, I had a lookup table that based on a age or gender got a rate or some
value.</span></p>
<p><span style="font-size:11pt;color:#1f497d"> </span></p>
<p><span style="font-size:11pt;color:#1f497d">Using
some Excel Trickery, I got the 2 dimensional table into one dimensional
columns of the type:</span></p>
<p><span style="font-size:11pt;color:#1f497d">Age
Gender Value</span></p>
<p><span style="font-size:11pt;color:#1f497d">Age
and Gender became conditions and Value became the Action.</span></p>
<p><span style="font-size:11pt;color:#1f497d"> </span></p>
<p><span style="font-size:11pt;color:#1f497d">In
your case, you could form a column with a dummy LHS(1=1) and keep all the
columns as Action Columns.</span></p>
<p><span style="font-size:11pt;color:#1f497d">In
each Action Column you could build up your Fact.</span></p>
<p><span style="font-size:11pt;color:#1f497d"> </span></p>
<p><span style="font-size:11pt;color:#1f497d">For
Example you could do the following:</span></p>
<p><span style="font-size:11pt;color:#1f497d"> </span></p>
<p><span style="font-size:11pt;color:#1f497d">Fact{
int a; int b;</span></p>
<p><span style="font-size:11pt;color:#1f497d">}</span></p>
<p><span style="font-size:11pt;color:#1f497d">Condition
Action
Action</span></p>
<p><span style="font-size:11pt;color:#1f497d">F:
Fact </span></p>
<p><span style="font-size:11pt;color:#1f497d">
f.set($1);
f.set($1)</span></p>
<p><span style="font-size:11pt;color:#1f497d">Eval(true)
Col
A
Col B</span></p>
<p><span style="font-size:11pt;color:#1f497d">Dummy
Value
<values for a> <values for
b></span></p>
<p><span style="font-size:11pt;color:#1f497d"> </span></p>
<p><span style="font-size:11pt;color:#1f497d">If
you generate a rule base out of this, it should load your tables straight as
facts.</span></p>
<p><span style="font-size:11pt;color:#1f497d"> </span></p>
<p><span style="font-size:11pt;color:#1f497d">However,
do note, that I did some rather Q&D benchmarks for this and soon realized
that the rulebase size and memory usage was getting really large. (Especially
the PermGen Size).</span></p>
<p><span style="font-size:11pt;color:#1f497d"> </span></p>
<p><span style="font-size:11pt;color:#1f497d">You
may want to have a look at the memory usage, in case you need to load a large
number of tables. Due, to the above(and other reasons), I just wrote a custom
parser using JXL (The same Excel Library Drools uses for Parsing Excels). It is
really neat and would make a simple solution.</span></p>
<p><span style="font-size:11pt;color:#1f497d"> </span></p>
<p><span style="font-size:11pt;color:#1f497d"> </span></p>
<p><span style="font-size:11pt;color:#1f497d">In,
case you get another solution do post it to the list.</span></p>
<p><span style="font-size:11pt;color:#1f497d"> </span></p>
<p><span style="font-size:11pt;color:#1f497d">Cheers,</span></p>
<p><span style="font-size:11pt;color:#1f497d">Vikrant
</span></p>
<p><span style="font-size:11pt;color:#1f497d"> </span></p>
<p><span style="font-size:11pt;color:#1f497d"> </span></p>
<p><span style="font-size:11pt;color:#1f497d"> </span></p>
<p><span style="font-size:11pt;color:#1f497d"> </span></p>
<p><span style="font-size:11pt;color:#1f497d"> </span></p>
<p><span style="font-size:11pt;color:#1f497d"> </span></p>
<p><span style="font-size:11pt;color:#1f497d"> </span></p>
<div>
<div style="border-right:medium none;padding-right:0in;border-top:#b5c4df 1pt solid;padding-left:0in;padding-bottom:0in;border-left:medium none;padding-top:3pt;border-bottom:medium none">
<p><b><span style="font-size:10pt">From:</span></b><span style="font-size:10pt">
<a href="mailto:rules-users-bounces@lists.jboss.org" target="_blank">rules-users-bounces@lists.jboss.org</a> [mailto:<a href="mailto:rules-users-bounces@lists.jboss.org" target="_blank">rules-users-bounces@lists.jboss.org</a>]
<b>On Behalf Of </b>Evans, Jess<br><b>Sent:</b> Thursday, October 09, 2008 11:54
PM<br><b>To:</b> <a href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a><br><b>Subject:</b> [rules-users]
fact base storage?</span></p></div></div>
<p> </p>
<div>
<p><span style="font-size:10pt">I'm trying to come up
to speed on the drools capabilities. I see that drools supports loading
rules from a decision table in a spreadsheet. I have a set of conversion
tables that I'd like to represent as facts asserted when the rule base has been
loaded, but before processing user requests. I could always model lookup
tables in a database, but I'd rather not have to build the CRUD interface
to manage them. I'd rather represent them so that each row in a
spreadsheet represents a fact (based upon a predefined java bean). Of
course, I could custom implement this functionality. However, I was
wondering if drools supports some OOTB means of loading facts from Excel or
other resource?</span></p></div>
<div>
<p> </p></div>
<div>
<p><span style="font-size:10pt">thanks,</span></p></div>
<div>
<p> </p></div>
<div>
<p><span style="font-size:10pt">-Jess</span></p></div>
<p style="margin-bottom:12pt"> </p>
<table style="background:white" cellpadding="0" border="0">
<tbody>
<tr>
<td style="padding-right:0.75pt;padding-left:0.75pt;padding-bottom:0.75pt;padding-top:0.75pt"></td></tr></tbody></table>
<p> </p></div><br><br>
<table style="color:black" bgcolor="white">
<tbody>
<tr>
<td><br>MASTEK LTD.<br>Mastek is in NASSCOM's 'India Top 20' Software Service Exporters List.<br>In the US, we're called MAJESCOMASTEK<br><br>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br>
Opinions expressed in this e-mail are those of the individual and not that of Mastek Limited, unless specifically indicated to that effect. Mastek Limited does not accept any responsibility or liability for it. This e-mail and attachments (if any) transmitted with it are confidential and/or privileged and solely for the use of the intended person or entity to which it is addressed. Any review, re-transmission, dissemination or other use of or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. This e-mail and its attachments have been scanned for the presence of computer viruses. It is the responsibility of the recipient to run the virus check on e-mails and attachments before opening them. If you have received this e-mail in error, kindly delete this e-mail from desktop and server.<br>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br></td></tr></tbody></table></div>
<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" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
<br></blockquote></div><br></div></div>