<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">


<META content="MSHTML 6.00.2800.1491" name=GENERATOR></HEAD>
<BODY text=#000000 bgColor=#ffffff>
<DIV><SPAN class=961564011-01052009><FONT face=Arial color=#0000ff 
size=2>Hello,</FONT></SPAN></DIV>
<DIV><SPAN class=961564011-01052009><FONT face=Arial color=#0000ff 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=961564011-01052009><FONT face=Arial color=#0000ff size=2>remove 
the final modifier for the getHomePage method, it's a problem related to 
shadowProxies, as they are CGLIB proxies they cannot proxy final 
methods...</FONT></SPAN></DIV>
<DIV><SPAN class=961564011-01052009><FONT face=Arial color=#0000ff 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=961564011-01052009><FONT face=Arial color=#0000ff 
size=2>-Patrick</FONT></SPAN></DIV>
<BLOCKQUOTE>
  <DIV class=OutlookMessageHeader dir=ltr align=left><FONT face=Tahoma 
  size=2>-----Message d'origine-----<BR><B>De&nbsp;:</B> 
  rules-users-bounces@lists.jboss.org 
  [mailto:rules-users-bounces@lists.jboss.org]<B>De la part de</B> Benoit 
  VILLAUMIE<BR><B>Envoyé&nbsp;:</B> mercredi, 20. août 2008 
  16:38<BR><B>À&nbsp;:</B> rules-users@lists.jboss.org<BR><B>Objet&nbsp;:</B> 
  [rules-users] Drools 4.0.7 - Rules not 
  fired<BR><BR></FONT></DIV>Hello,<BR><BR>I am using Drools engine 4.0.7 and 
  Eclipse 3.3 drools plugin.<BR><BR>I have a very basic/dumb problem but I do 
  not understand where my error is :<BR><BR>I have 2 rules 
  <BR>---------------------------------<BR>
  <BLOCKQUOTE>package poc<BR><BR>import poc.FlashFact;<BR><BR><B>rule "HP 
    one"</B><BR>&nbsp;&nbsp;&nbsp; when<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
    FlashFact( homepage == "one");<BR>&nbsp;&nbsp;&nbsp; 
    then<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; System.out.println("*** HP 
    one");<BR>end<BR><BR><B>rule "HP commons"</B><BR>&nbsp;&nbsp;&nbsp; 
    when<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
    FlashFact();<BR>&nbsp;&nbsp;&nbsp; then<BR>&nbsp;&nbsp;&nbsp; 
    &nbsp;&nbsp;&nbsp; System.out.println("*** HP commons 
  ");<BR>end<BR></BLOCKQUOTE>----------------------------------<BR><BR>I insert 
  a FlashFact which homepage is set with "one" value.<BR><BR>In my 
  understanding, both rules "HP one" and "HP commons" should be fired. Instead, 
  only "HP commons" is launched. I have compared with the Drools State example 
  (which works fine), but I do not notice nothing.<BR><BR>Thanks for your 
  help.<BR><BR>The code of the FlashFact 
  class<BR>---------------------------------<BR>
  <BLOCKQUOTE>package poc;<BR><BR>public class FlashFact 
    {<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; public FlashFact() 
    {<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; this(null);<BR>&nbsp;&nbsp;&nbsp; 
    }<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; public FlashFact(String 
    homepage) {<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
    this.setHomepage(homepage);<BR>&nbsp;&nbsp;&nbsp; }&nbsp;&nbsp;&nbsp; 
    <BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; private String 
    homepage;<BR><BR>&nbsp;&nbsp;&nbsp; /**<BR>&nbsp;&nbsp;&nbsp; &nbsp;* 
    @return the homepage<BR>&nbsp;&nbsp;&nbsp; &nbsp;*/<BR>&nbsp;&nbsp;&nbsp; 
    public final String getHomepage() {<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
    return this.homepage;<BR>&nbsp;&nbsp;&nbsp; }<BR><BR>&nbsp;&nbsp;&nbsp; 
    /**<BR>&nbsp;&nbsp;&nbsp; &nbsp;* @param homepage the homepage to 
    set<BR>&nbsp;&nbsp;&nbsp; &nbsp;*/<BR>&nbsp;&nbsp;&nbsp; public final void 
    setHomepage(String homepage) {<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
    this.homepage = homepage;<BR>&nbsp;&nbsp;&nbsp; 
  }<BR><BR>}<BR></BLOCKQUOTE>---------------------------------<BR><BR>The code 
  of the launcher<BR>---------------------------------<BR>package 
  poc;<BR><BR>import java.io.InputStreamReader;<BR><BR>import 
  org.drools.RuleBase;<BR>import org.drools.RuleBaseFactory;<BR>import 
  org.drools.StatefulSession;<BR>import 
  org.drools.audit.WorkingMemoryFileLogger;<BR>import 
  org.drools.compiler.PackageBuilder;<BR><BR>public class 
  FlashUndeployedRulesMain {<BR><BR>&nbsp;&nbsp;&nbsp; public static void 
  main(String[] args) throws Exception {<BR>&nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp; StatefulSession session = null;<BR>&nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp; WorkingMemoryFileLogger logger = 
  null;<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; try {<BR>&nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; PackageBuilder builder = new 
  PackageBuilder();<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
  builder.addPackageFromDrl(new InputStreamReader(<BR>&nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
  FlashUndeployedRulesMain.class.getClassLoader()<BR>&nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
  .getResourceAsStream(RULE)));<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp; final RuleBase ruleBase = 
  RuleBaseFactory.newRuleBase();<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp; 
  ruleBase.addPackage(builder.getPackage());<BR>&nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; session = 
  ruleBase.newStatefulSession();<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp; logger = new WorkingMemoryFileLogger(<BR>&nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
  session);<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
  logger.setFileName("log/flash");<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp; // inserting facts<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp; FlashFact HPFrance = new FlashFact("one"); 
  <BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
  <BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
  session.insert(HPFrance);<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp; session.fireAllRules();<BR>&nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp; } finally {<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp; if(session != null) 
  {session.dispose();}<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
  &nbsp;&nbsp;&nbsp; if(logger != null) 
  {logger.writeToDisk();}<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
  }<BR>&nbsp;&nbsp;&nbsp; }<BR><BR>&nbsp;&nbsp;&nbsp; private static final 
  String RULE = 
"poc/Flash.drl";<BR>---------------------------------<BR><BR><BR></BLOCKQUOTE></BODY></HTML>