We have few .drl files where we are inserting EligibleAlert into working memory. Should we declare with @role(event) in all the files or only once  anywhere??<br><br>Currently I have declared it as an @role(event)  in the current drools file where I am applying <br>
temporal reasoning. Is tht only sufficient.. ? or in all.drl files? <br><br>Or in the .drl file, where for the first time it is being inserted into WM?? I am clueless..<br><br><br><br><div class="gmail_quote">2009/11/10 Edson Tirelli <span dir="ltr">&lt;<a href="mailto:ed.tirelli@gmail.com">ed.tirelli@gmail.com</a>&gt;</span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>   Assuming this is the offending rule, for some reason, Drools is not interpreting EligibleAlert as an &quot;event&quot;. You need to double check your code to make sure it is declared with @role( event ) as previously mentioned by Mauricio.<div>
<div></div><div class="h5"><br>
<br>   []s<br>   Edson<br><br><div class="gmail_quote">2009/11/9 Chetan Mahadev <span dir="ltr">&lt;<a href="mailto:mahadev.chetan@gmail.com" target="_blank">mahadev.chetan@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

Etirelli,<br><br>So u mean to say, some other rule is causing the problem?<br><br>I have this rule which uses events from entry-point after it is being inserted in my earlier rule..<br><br>rule &quot;testRule&quot;<br>no-loop true<br>


  when<br>     <br>    $eventSignature : EventSignature($list : syslogmnemonicList, totalevents == &quot;2&quot;)<br>    $e1:EligibleAlert($a1 : alert, <br>               eval(ifMatches($list,$a1))<br>             )  from entry-point &quot;EVENT SIGNATURE STREAM&quot;   <br>


   <br>    $e2:EligibleAlert($a2 : alert,<br>              //     $a2.processed!=&quot;TRUE&quot;,<br>               //    $a1.customerId==$a2.customerId,<br>               //($a1.alternateAlertText!= $a2.alternateAlertText) ,<br>


               eval(ifMatches($list,$a1)),<br>               eval(ifMatches($list,$a2)),<br>               this after[0, 20s] $e1 <br>             )  from entry-point &quot;EVENT SIGNATURE STREAM&quot;<br>    <br> <br>                            <br>


    not(EligibleAlert(<br>                this after $e1, <br>                this before $e2<br>              ) from entry-point &quot;EVENT SIGNATURE STREAM&quot;)<br>             <br>then<br>  log.debug(&quot;[EventSignature]*******RULE: TEST&quot; );<br>


  log.debug(&quot;[EventSignature]------------------------------------------------------------------------------------&quot; );<br>  log.debug(&quot;[EventSignature]        STATUS : &quot;+$list);<br>   log.debug(&quot;[EventSignature]        ALERT : &quot;+$e1.getAlert().getAlternateAlertText());<br>


   log.debug(&quot;[EventSignature]        COMMONINFO : &quot; +$e1.getAlert().getCommonInfo());<br>   <br>  <br>  log.debug(&quot;[EventSignature]        ALERT : &quot;+$e2.getAlert().getAlternateAlertText());<br>  log.debug(&quot;[EventSignature]        COMMONINFO : &quot; +$e2.getAlert().getCommonInfo());<br>


  log.debug(&quot;[EventSignature]        SIGNATURE : &quot;+$eventSignature.getEventsignature());<br>  log.debug(&quot;[EventSignature]------------------------------------------------------------------------------------&quot; );<br>


 <br>  <br>end<br><br>Where do you see the problem?? Pls help...<br><br><div class="gmail_quote">2009/11/9 Edson Tirelli <span dir="ltr">&lt;<a href="mailto:ed.tirelli@gmail.com" target="_blank">ed.tirelli@gmail.com</a>&gt;</span><div>

<div></div><div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>   The stack trace shows the problem is happening in a use of the &quot;after&quot; evaluator:<div><br><br>2009-11-09 15:02:00,676 FATAL pool-2-thread-1 LogStream -       at org.drools.base.evaluators.AfterEvaluatorDefinition$AfterEvaluator.evaluateCachedRight(AfterEvaluatorDefinition.java:321)<br>




<br></div>    So, the attached rule is not the source of the problem, although it might be the rule &quot;triggering&quot; the problem because of the event forwarding in the consequence. Remember that the After operator is supposed to work on events, java.util.Date, and long (for timestamps). Anything else will raise errors.<br>



<br>    Finally, on a different subject, you can simplify your consequence, as this:<div><br><br>WorkingMemoryEntryPoint eventsignaturestream = drools.getEntryPoint(&quot;EVENT SIGNATURE STREAM&quot;) ;<br>eventsignaturestream.insert($p);<br>



<br></div>   Is the same as:<br><br>entryPoints[&quot;EVENT SIGNATURE STREAM&quot;].insert( $p );<br><br>   []s<br>   Edson<br><br><div class="gmail_quote"><div>2009/11/9 Chetan Mahadev <span dir="ltr">&lt;<a href="mailto:mahadev.chetan@gmail.com" target="_blank">mahadev.chetan@gmail.com</a>&gt;</span><br>



</div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br><div><div></div><div>Hi I am getting the following error while inserting into the entrypoint.<br>


<br>rule &quot;Check if EligibleAlert is an Signature Event&quot;<br>
agenda-group &quot;enrichment&quot;<br>auto-focus true<br><br>no-loop true<br>
when<br>    $list : EventSignatureList();<br>    $p : EligibleAlert($a : alert, $a.eventSignatureProcessingStatus!=&quot;TRUE&quot; );<br>    eval((ifMatchesSyslog($list.getAllSyslogMnemonics(), $a)!=null)  )<br><br>then<br>




        try{<br>                WorkingMemoryEntryPoint eventsignaturestream = drools.getEntryPoint(&quot;EVENT SIGNATURE STREAM&quot;) ;<br>                eventsignaturestream.insert($p);<br>                } catch(Exception e)<br>




        {<br>            log.error(&quot;[EventSignatureRules] - exception in Check if EligibleAlert is an Signature Event alert[ids=&quot; + $p.getAlert().getId() + &quot;][error:&quot; + e.toString() + &quot;]&quot;);<br>




        }<br>end<br><br>And I am creating the session this way:<br><b><br>        knowledgeBaseConfig = KnowledgeBaseFactory.newKnowledgeBaseConfiguration();<br>        knowledgeBaseConfig.setOption( EventProcessingOption.STREAM );<br>




        kBase = KnowledgeBaseFactory.newKnowledgeBase( knowledgeBaseConfig );<br>        <br><br>        kBase.addKnowledgePackages(knowledgeBuilder.getKnowledgePackages());<br>        <br>        <br>        KnowledgeSessionConfiguration knowledgeSessionConfig =  KnowledgeBaseFactory.newKnowledgeSessionConfiguration();<br>




        ((SessionConfiguration) knowledgeSessionConfig).setClockType( ClockType.REALTIME_CLOCK );<br>          kBase.newStatefulKnowledgeSession(knowledgeSessionConfig,null);</b><br><br><br>I get the Following error when my rule fires:<br>




<br>2009-11-09 15:02:00,675 FATAL pool-2-thread-1 LogStream - java.lang.ClassCastException: org.drools.common.DefaultFactHandle cannot be cast to org.drools.common.EventFactHandle<br>2009-11-09 15:02:00,676 FATAL pool-2-thread-1 LogStream -       at org.drools.base.evaluators.AfterEvaluatorDefinition$AfterEvaluator.evaluateCachedRight(AfterEvaluatorDefinition.java:321)<br>




2009-11-09 15:02:00,676 FATAL pool-2-thread-1 LogStream -       at org.drools.rule.VariableRestriction.isAllowedCachedRight(VariableRestriction.java:116)<br>2009-11-09 15:02:00,676 FATAL pool-2-thread-1 LogStream -       at org.drools.rule.VariableConstraint.isAllowedCachedRight(VariableConstraint.java:112)<br>




2009-11-09 15:02:00,676 FATAL pool-2-thread-1 LogStream -       at org.drools.common.DefaultBetaConstraints.isAllowedCachedRight(DefaultBetaConstraints.java:200)<br>2009-11-09 15:02:00,676 FATAL pool-2-thread-1 LogStream -       at org.drools.reteoo.JoinNode.assertObject(JoinNode.java:172)<br>




2009-11-09 15:02:00,676 FATAL pool-2-thread-1 LogStream -       at org.drools.reteoo.SingleObjectSinkAdapter.propagateAssertObject(SingleObjectSinkAdapter.java:42)<br>2009-11-09 15:02:00,676 FATAL pool-2-thread-1 LogStream -       at org.drools.reteoo.PropagationQueuingNode$AssertAction.execute(PropagationQueuingNode.java:326)<br>




2009-11-09 15:02:00,676 FATAL pool-2-thread-1 LogStream -       at org.drools.reteoo.PropagationQueuingNode.propagateActions(PropagationQueuingNode.java:221)<br>2009-11-09 15:02:00,676 FATAL pool-2-thread-1 LogStream -       at org.drools.reteoo.PropagationQueuingNode$PropagateAction.execute(PropagationQueuingNode.java:394)<br>




2009-11-09 15:02:00,676 FATAL pool-2-thread-1 LogStream -       at org.drools.common.AbstractWorkingMemory.executeQueuedActions(AbstractWorkingMemory.java:1486)<br>2009-11-09 15:02:00,676 FATAL pool-2-thread-1 LogStream -       at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:158)<br>




2009-11-09 15:02:00,676 FATAL pool-2-thread-1 LogStream -       at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:122)<br>2009-11-09 15:02:00,676 FATAL pool-2-thread-1 LogStream -       at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:80)<br>




2009-11-09 15:02:00,676 FATAL pool-2-thread-1 LogStream -       at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:28)<br>2009-11-09 15:02:00,676 FATAL pool-2-thread-1 LogStream -       at pnoc.alertProcessor.Rule_Check_if_EligibleAlert_is_an_Signature_Event_0.consequence(Rule_Check_if_EligibleAlert_is_an_Signature_Event_0.java:16)<br>




2009-11-09 15:02:00,676 FATAL pool-2-thread-1 LogStream -       at pnoc.alertProcessor.Rule_Check_if_EligibleAlert_is_an_Signature_Event_0ConsequenceInvoker.evaluate(Rule_Check_if_EligibleAlert_is_an_Signature_Event_0ConsequenceInvoker.java:24)<br>




<br>Pls help!<br><br><br>Regds<br><font color="#888888">Chetan<br>
</font><br></div></div><div>_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org" target="_blank">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></div></blockquote></div><font color="#888888"><br><br clear="all"><br>-- <br>  Edson Tirelli<br>  JBoss Drools Core Development<br>  JBoss by Red Hat @ <a href="http://www.jboss.com" target="_blank">www.jboss.com</a><br>



</font><br>_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org" target="_blank">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></div></div><br>
<br>_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org" target="_blank">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><br clear="all"><br>-- <br>  Edson Tirelli<br>  JBoss Drools Core Development<br>  JBoss by Red Hat @ <a href="http://www.jboss.com" target="_blank">www.jboss.com</a><br>
</div></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>