<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2800.1589" name=GENERATOR></HEAD>
<BODY text=#000000 bgColor=#ffffff>
<DIV dir=ltr align=left><SPAN class=501440016-17042007><FONT face=Arial
color=#0000ff size=2>Thanks for the notes guys. However it doesn't look
like SXC will do it for me. I'm currently using multiple functions from
XPath 2.0 and it doesn't look like SXC supports it yet. I may however look
at how SXC implements it, and see if I can do a similar
thing.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=501440016-17042007><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=501440016-17042007><FONT face=Arial
color=#0000ff size=2>I would like to hear some more suggestions if you have
some? :)</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=501440016-17042007><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=501440016-17042007><FONT face=Arial
color=#0000ff size=2>Thank you,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=501440016-17042007><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=501440016-17042007><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=501440016-17042007><FONT face=Arial
color=#0000ff size=2>Steve.</FONT></SPAN></DIV><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> rules-users-bounces@lists.jboss.org
[mailto:rules-users-bounces@lists.jboss.org] <B>On Behalf Of </B>Mark
Proctor<BR><B>Sent:</B> Tuesday, April 17, 2007 10:15 AM<BR><B>To:</B> Rules
Users List<BR><B>Subject:</B> Re: [rules-users] Efficiency of rules with
XPath...<BR></FONT><BR></DIV>
<DIV></DIV>use SXC its a high perfromance XPath parser with JBRules integration,
no need to use eval. <BR><A class=moz-txt-link-freetext
href="http://sxc.codehaus.org/">http://sxc.codehaus.org/</A><BR><BR>Mark<BR>Schwenker,
Stephen wrote:
<BLOCKQUOTE
cite=mid:FBEF1EF7B7E5B649AB1C684991223C6E0636F035@tmg-mail2.torstar.net
type="cite">
<META content="MSHTML 6.00.2800.1589" name=GENERATOR><FONT
color=#960000></FONT>
<DIV><FONT color=#960000><FONT face=Arial color=#000000 size=2><SPAN
class=751293912-17042007>Hey all,</SPAN></FONT></FONT></DIV>
<DIV><FONT color=#960000><FONT face=Arial color=#000000 size=2><SPAN
class=751293912-17042007></SPAN></FONT></FONT> </DIV>
<DIV><FONT color=#960000><FONT face=Arial color=#000000 size=2><SPAN
class=751293912-17042007>I'm trying to make my rule more efficient but I'm not
sure how. I've designed my rules based around xml objects.
Basically, I have these documents and XPath queries are executed against the
Object to determine if the rule should be executed. The problems is, is
that we have over 900 rules that need to be executed. The performance
isn't really that bad but I would like to Make it even
better.</SPAN></FONT></FONT></DIV>
<DIV><FONT color=#960000><FONT face=Arial color=#000000 size=2><SPAN
class=751293912-17042007></SPAN></FONT></FONT> </DIV>
<DIV><FONT color=#960000><FONT face=Arial color=#000000 size=2><SPAN
class=751293912-17042007>To do the job, I have written an XmlUtils class
to execute the expression. The class first gets the XPathFactory.
Then compiles the expression and then executes the expression. This
happens for every expression, and will happen each time the same expression is
executed. I want to make the rules more efficient by getting the
XPathFactory once and compiling the expression once and then execute the
expression n time on the same compiled object.</SPAN></FONT></FONT></DIV>
<DIV><FONT color=#960000><FONT face=Arial color=#000000 size=2><SPAN
class=751293912-17042007></SPAN></FONT></FONT> </DIV>
<DIV><FONT color=#960000><FONT face=Arial color=#000000 size=2><SPAN
class=751293912-17042007>I would like to know if there is a way I can have the
rule object that is generated by the package build do the compile of the XPath
Expression and then use it instead of compiling it every
time.</SPAN></FONT></FONT></DIV>
<DIV><FONT color=#960000><FONT face=Arial color=#000000 size=2><SPAN
class=751293912-17042007></SPAN></FONT></FONT> </DIV>
<DIV><FONT color=#960000><FONT face=Arial color=#000000 size=2><SPAN
class=751293912-17042007>Here is a sample of one of my rule
criteria.</SPAN></FONT></FONT></DIV>
<DIV><FONT color=#960000></FONT> </DIV>
<DIV><FONT color=#960000><FONT face=Arial><FONT color=#000000><FONT
size=2><SPAN class=751293912-17042007> </SPAN>asset:
AssetDocument()</FONT></FONT></FONT></FONT></DIV>
<DIV><FONT color=#000000><FONT size=2><STRONG><FONT face=Arial><SPAN
class=751293912-17042007> </SPAN>eval</FONT></STRONG><FONT
face=Arial>( XmlUtils.evaluatePathBoolean( asset,
"boolean(//ass:asset/ass:properties/ass:property[@name =
'Desk']/ass:value/text() = 'column')") )</FONT></FONT></FONT></DIV><PRE wrap=""><HR width="90%" SIZE=4>
_______________________________________________
rules-users mailing list
<A class=moz-txt-link-abbreviated href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</A>
<A class=moz-txt-link-freetext href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</A>
</PRE></BLOCKQUOTE><BR></BODY></HTML>