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??
Currently I have declared it as an @role(event) in the current drools file where I am applying
temporal reasoning. Is tht only sufficient.. ? or in all.drl files?
Or in the .drl file, where for the first time it is being inserted into WM?? I am clueless..
Assuming this is the offending rule, for some reason, Drools is not interpreting EligibleAlert as an "event". You need to double check your code to make sure it is declared with @role( event ) as previously mentioned by Mauricio.
[]s
Edson2009/11/9 Chetan Mahadev <mahadev.chetan@gmail.com>Etirelli,
So u mean to say, some other rule is causing the problem?
I have this rule which uses events from entry-point after it is being inserted in my earlier rule..
rule "testRule"
no-loop true
when
$eventSignature : EventSignature($list : syslogmnemonicList, totalevents == "2")
$e1:EligibleAlert($a1 : alert,
eval(ifMatches($list,$a1))
) from entry-point "EVENT SIGNATURE STREAM"
$e2:EligibleAlert($a2 : alert,
// $a2.processed!="TRUE",
// $a1.customerId==$a2.customerId,
//($a1.alternateAlertText!= $a2.alternateAlertText) ,
eval(ifMatches($list,$a1)),
eval(ifMatches($list,$a2)),
this after[0, 20s] $e1
) from entry-point "EVENT SIGNATURE STREAM"
not(EligibleAlert(
this after $e1,
this before $e2
) from entry-point "EVENT SIGNATURE STREAM")
then
log.debug("[EventSignature]*******RULE: TEST" );
log.debug("[EventSignature]------------------------------------------------------------------------------------" );
log.debug("[EventSignature] STATUS : "+$list);
log.debug("[EventSignature] ALERT : "+$e1.getAlert().getAlternateAlertText());
log.debug("[EventSignature] COMMONINFO : " +$e1.getAlert().getCommonInfo());
log.debug("[EventSignature] ALERT : "+$e2.getAlert().getAlternateAlertText());
log.debug("[EventSignature] COMMONINFO : " +$e2.getAlert().getCommonInfo());
log.debug("[EventSignature] SIGNATURE : "+$eventSignature.getEventsignature());
log.debug("[EventSignature]------------------------------------------------------------------------------------" );
end
Where do you see the problem?? Pls help...2009/11/9 Edson Tirelli <ed.tirelli@gmail.com>
The stack trace shows the problem is happening in a use of the "after" evaluator:So, the attached rule is not the source of the problem, although it might be the rule "triggering" 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.
2009-11-09 15:02:00,676 FATAL pool-2-thread-1 LogStream - at org.drools.base.evaluators.AfterEvaluatorDefinition$AfterEvaluator.evaluateCachedRight(AfterEvaluatorDefinition.java:321)
Finally, on a different subject, you can simplify your consequence, as this:Is the same as:
WorkingMemoryEntryPoint eventsignaturestream = drools.getEntryPoint("EVENT SIGNATURE STREAM") ;
eventsignaturestream.insert($p);
entryPoints["EVENT SIGNATURE STREAM"].insert( $p );
[]s
Edson2009/11/9 Chetan Mahadev <mahadev.chetan@gmail.com>
Hi I am getting the following error while inserting into the entrypoint.
rule "Check if EligibleAlert is an Signature Event"
agenda-group "enrichment"
auto-focus true
no-loop true
when
$list : EventSignatureList();
$p : EligibleAlert($a : alert, $a.eventSignatureProcessingStatus!="TRUE" );
eval((ifMatchesSyslog($list.getAllSyslogMnemonics(), $a)!=null) )
then
try{
WorkingMemoryEntryPoint eventsignaturestream = drools.getEntryPoint("EVENT SIGNATURE STREAM") ;
eventsignaturestream.insert($p);
} catch(Exception e)
{
log.error("[EventSignatureRules] - exception in Check if EligibleAlert is an Signature Event alert[ids=" + $p.getAlert().getId() + "][error:" + e.toString() + "]");
}
end
And I am creating the session this way:
knowledgeBaseConfig = KnowledgeBaseFactory.newKnowledgeBaseConfiguration();
knowledgeBaseConfig.setOption( EventProcessingOption.STREAM );
kBase = KnowledgeBaseFactory.newKnowledgeBase( knowledgeBaseConfig );
kBase.addKnowledgePackages(knowledgeBuilder.getKnowledgePackages());
KnowledgeSessionConfiguration knowledgeSessionConfig = KnowledgeBaseFactory.newKnowledgeSessionConfiguration();
((SessionConfiguration) knowledgeSessionConfig).setClockType( ClockType.REALTIME_CLOCK );
kBase.newStatefulKnowledgeSession(knowledgeSessionConfig,null);
I get the Following error when my rule fires:
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
2009-11-09 15:02:00,676 FATAL pool-2-thread-1 LogStream - at org.drools.base.evaluators.AfterEvaluatorDefinition$AfterEvaluator.evaluateCachedRight(AfterEvaluatorDefinition.java:321)
2009-11-09 15:02:00,676 FATAL pool-2-thread-1 LogStream - at org.drools.rule.VariableRestriction.isAllowedCachedRight(VariableRestriction.java:116)
2009-11-09 15:02:00,676 FATAL pool-2-thread-1 LogStream - at org.drools.rule.VariableConstraint.isAllowedCachedRight(VariableConstraint.java:112)
2009-11-09 15:02:00,676 FATAL pool-2-thread-1 LogStream - at org.drools.common.DefaultBetaConstraints.isAllowedCachedRight(DefaultBetaConstraints.java:200)
2009-11-09 15:02:00,676 FATAL pool-2-thread-1 LogStream - at org.drools.reteoo.JoinNode.assertObject(JoinNode.java:172)
2009-11-09 15:02:00,676 FATAL pool-2-thread-1 LogStream - at org.drools.reteoo.SingleObjectSinkAdapter.propagateAssertObject(SingleObjectSinkAdapter.java:42)
2009-11-09 15:02:00,676 FATAL pool-2-thread-1 LogStream - at org.drools.reteoo.PropagationQueuingNode$AssertAction.execute(PropagationQueuingNode.java:326)
2009-11-09 15:02:00,676 FATAL pool-2-thread-1 LogStream - at org.drools.reteoo.PropagationQueuingNode.propagateActions(PropagationQueuingNode.java:221)
2009-11-09 15:02:00,676 FATAL pool-2-thread-1 LogStream - at org.drools.reteoo.PropagationQueuingNode$PropagateAction.execute(PropagationQueuingNode.java:394)
2009-11-09 15:02:00,676 FATAL pool-2-thread-1 LogStream - at org.drools.common.AbstractWorkingMemory.executeQueuedActions(AbstractWorkingMemory.java:1486)
2009-11-09 15:02:00,676 FATAL pool-2-thread-1 LogStream - at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:158)
2009-11-09 15:02:00,676 FATAL pool-2-thread-1 LogStream - at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:122)
2009-11-09 15:02:00,676 FATAL pool-2-thread-1 LogStream - at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:80)
2009-11-09 15:02:00,676 FATAL pool-2-thread-1 LogStream - at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:28)
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)
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)
Pls help!
Regds
Chetan
_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
--
Edson Tirelli
JBoss Drools Core Development
JBoss by Red Hat @ www.jboss.com
_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
--
Edson Tirelli
JBoss Drools Core Development
JBoss by Red Hat @ www.jboss.com
_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users