[rules-users] What is the Best practice of using "Drools Fusion" in a Load balancing environment (ie temporal reasoning between 2 working memories)??
Hi Can anyone tell me how to Implement temporal based event correlation using drools fusion in a load balancing environment. What is the best practice in a situation like this?? Use case : To correlate events which comes into the system with in a time window. Scenario1: Single System Scenario: that is One working memory 1.All the events come into the system, 2.Temporal based rules are written using Drools-Fusion. 3.Correlations takes place if all the events come with in the time window, else the rule expires. Note: All these takes place with in a single working memory ( Single System) Scenario2: Two System Scenario in active/active: that is two working memories 1.All the events come into the system, 2.Temporal based rules are written using Drools-Fusion. 3. Same rules are deployed in both the systems (active/active) 4.Both systems are load-balanced, 5. Event1 goes to System1, Event2 goes to System2 and again Event3 goes system1. ( load -balanced) As a result, System1 recieves 2 events out of 3 events, and System2 the other 1 event. Correlation never happens since I dont recieve all the events in a single working memory. How do we handle this kinda scenario?? Do we have any best practise that is followed in a clustered or load-balanced environment?? Pls help me.. I am stuck. Regds Chetan In a single system, Fusion/temporal based correlation works completely fine. Use case: I have a situation, where events flow into two active components (both running simultaneosly) ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] Fusion : Timebased rules fire only for the first time after the start of the application (tomcat)
Hi I am trying to correlate two or more events when a condition gets satisfied. The rule is working fine only when i start my tomcat, and it fires only for the first match of the events. But subsequent events fails to correalte ( or rule doesnt fire). Am not sure wats the issue. Currently I am using the following config when i build my KnowledgeBase: knowledgeBaseConfig = KnowledgeBaseFactory.newKnowledgeBaseConfiguration(); knowledgeBaseConfig.setOption( EventProcessingOption.STREAM ); kBase = KnowledgeBaseFactory.newKnowledgeBase( knowledgeBaseConfig ); //kBase = newKbase(); kBase.addKnowledgePackages(knowledgeBuilder.getKnowledgePackages()); KnowledgeSessionConfiguration knowledgeSessionConfig = KnowledgeBaseFactory.newKnowledgeSessionConfiguration(); ((SessionConfiguration) knowledgeSessionConfig).setClockType( ClockType.REALTIME_CLOCK ); Can anybody help here?? Regds Chetan ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Fusion [Error]- java.lang.ClassCastException: org.drools.common.DefaultFactHandle cannot be cast to org.drools.common.EventFactHandle
Hi Edson, Salaboy, Just to explain what I meant in my previous mail... This is wat we are doin... We are inserting a EligibleAlert in one of the rules like this.This is a seperate drl file.. I tried declaring EligibleAlert as an event in this .drl file. rule "process pending sympathetic alert" agenda-group "AlertProcessing" auto-focus true no-loop salience 50 when ProcessedAlert ( rootCause == true, $alarmId : alarmIdentifier, ticketed == true, $custId: companyId ); $pendingAlert : PendingAlert ( rootCause == false, rootCauseId == $alarmId, companyId == $custId ); then Alert $alert = $pendingAlert.getAlert(); try { insert ( new EligibleAlert($alert) ); } catch (Throwable e) { insert(new RuleProcessingError("[processing] process pending sympathetic alert", $alert, e)); log.error("[processing] ERROR - process pending sympathetic alert [alert=" + $alert.getId() + "][error=" + e.toString() + "]"); } end Drl file 2: - declare EligibleAlert @role( event ) end rule "Check if EligibleAlert is an Signature Event" agenda-group "enrichment" auto-focus true //salience 100 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 rule "testRule" agenda-group "enrichment" salience 105 auto-focus true no-loop true when $e1:EligibleAlert($a1 : alert ) from entry-point "EVENT SIGNATURE STREAM" $e2:EligibleAlert($a2 : alert, 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] 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]" ); end Hope this helps in correcting my mistake anywhere. Regds Chetan On Tue, Nov 10, 2009 at 7:58 AM, Chetan Mahadev wrote: > 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.. > > > > 2009/11/10 Edson Tirelli > > >>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 >>Edson >> >> 2009/11/9 Chetan Mahadev >> >>> 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" >>> n
Re: [rules-users] Fusion [Error]- java.lang.ClassCastException: org.drools.common.DefaultFactHandle cannot be cast to org.drools.common.EventFactHandle
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.. 2009/11/10 Edson Tirelli > >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 > Edson > > 2009/11/9 Chetan Mahadev > >> 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 >> >> >>>The stack trace shows the problem is happening in a use of the "after" >>> evaluator: >>> >>> >>> 2009-11-09 15:02:00,676 FATAL pool-2-thread-1 LogStream - at >>> org.drools.base.evaluators.AfterEvaluatorDefinition$AfterEvaluator.evaluateCachedRight(AfterEvaluatorDefinition.java:321) >>> >>> 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. >>> >>> Finally, on a different subject, you can simplify your consequence, >>> as this: >>> >>> >>> WorkingMemoryEntryPoint eventsignaturestream = >>> drools.getEntryPoint("EVENT SIGNATURE STREAM") ; >>> eventsignaturestream.insert($p); >>> >>>Is the same as: >>> >>> entryPoints["EVENT SIGNATURE STREAM"].insert( $p ); >>> >>>[]s >>>Edson >>> >>> 2009/11/9 Chetan Mahadev >>> >>>> >>>> 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 >>
Re: [rules-users] Fusion [Error]- java.lang.ClassCastException: org.drools.common.DefaultFactHandle cannot be cast to org.drools.common.EventFactHandle
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 > >The stack trace shows the problem is happening in a use of the "after" > evaluator: > > > 2009-11-09 15:02:00,676 FATAL pool-2-thread-1 LogStream - at > org.drools.base.evaluators.AfterEvaluatorDefinition$AfterEvaluator.evaluateCachedRight(AfterEvaluatorDefinition.java:321) > > 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. > > Finally, on a different subject, you can simplify your consequence, as > this: > > > WorkingMemoryEntryPoint eventsignaturestream = drools.getEntryPoint("EVENT > SIGNATURE STREAM") ; > eventsignaturestream.insert($p); > >Is the same as: > > entryPoints["EVENT SIGNATURE STREAM"].insert( $p ); > >[]s >Edson > > 2009/11/9 Chetan Mahadev > >> >> 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); >> * >>
Re: [rules-users] Fusion [Error]- java.lang.ClassCastException: org.drools.common.DefaultFactHandle cannot be cast to org.drools.common.EventFactHandle
Hi Mauricio,, I have already declared it as an event as shown below... yet it cribs declare EligibleAlert @role( event ) //@expires(90s) end rule "Check if EligibleAlert is an Signature Event" agenda-group "enrichment" auto-focus true //salience 100 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 2009/11/9 Mauricio Salatino > Hi, > Did you do something like: > declare EligibleAlert > @role(event) > end > > in your DRL? > you need to declare which facts are events. > > 2009/11/9 Chetan Mahadev > >> >> 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) >&g
[rules-users] Fusion [Error]- java.lang.ClassCastException: org.drools.common.DefaultFactHandle cannot be cast to org.drools.common.EventFactHandle
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
Re: [rules-users] [Fusion ] - Can we pass time value as a parameter in Temporal operator??
>>I think that you ask this questions because you probably have a lot of similar rules with >>different time periods right? Yes , I have some cases where only the time periods applied for temporal reasoning change. I was thinking of generalizing with a single rule instead of writing rules for each of the cases, and passing time as a parameter in the rule. Am not sure if its a good idea to pass time as a variable or not, but i thought it is a cool feature to have that kinda flexiblity. Regds Chetan 2009/11/3 Mauricio Salatino > I don't know, we can ask Edson Terelli about that. > If you think about it, its good that the rule condition is always constant. > Because it will describe a static situation in your context. > This, will cause that when you have problems with that rule you will know > exactly what the condition is. > I think that you ask this questions because you probably have a lot of > similar rules with different time periods right? > > > 2009/11/3 Chetan Mahadev > > Maurico, >> >> Any plans in the future releases of Fusion?? >> >> Regds >> Chetan >> >> >> On Tue, Nov 3, 2009 at 12:40 AM, Greg Barton wrote: >> >>> You could do this by generating the rule text, but it would no be >>> dynamic. (i.e. you'd have to regenerate the rule and reload it into the >>> ruleset.) >>> >>> --- On Mon, 11/2/09, Mauricio Salatino wrote: >>> >>> > From: Mauricio Salatino >>> > Subject: Re: [rules-users] [Fusion ] - Can we pass time value as a >>> parameter in Temporal operator?? >>> > To: "Rules Users List" >>> > Date: Monday, November 2, 2009, 11:45 AM >>> > no, right now that is not possible. >>> > >>> > 2009/11/2 Chetan Mahadev >>> > >>> > >>> > Hi, >>> > >>> > Is it possible to pass the time value as a >>> > "parameter" in temporal operator?? >>> > In the below example, I would like to pass $time as a >>> > variable, any integer value/String value representing >>> > time. ( ex: $time = 10s) >>> > >>> > >>> > >>> > >>> > >>> > Ex; >>> > $eventA : EventA( this after[ $time >>> > s ] $eventB ) >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > ___ >>> > >>> > rules-users mailing list >>> > >>> > rules-users@lists.jboss.org >>> > >>> > https://lists.jboss.org/mailman/listinfo/rules-users >>> > >>> > >>> > >>> > >>> > >>> > -- >>> > - http://salaboy.wordpress.com >>> > - http://www.jbug.com.ar >>> > - Salatino "Salaboy" Mauricio - >>> > >>> > >>> > >>> > -Inline Attachment Follows- >>> > >>> > ___ >>> > 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 >>> >> >> >> ___ >> rules-users mailing list >> rules-users@lists.jboss.org >> https://lists.jboss.org/mailman/listinfo/rules-users >> >> > > > -- > - http://salaboy.wordpress.com > - http://www.jbug.com.ar > - Salatino "Salaboy" Mauricio - > > ___ > 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
Re: [rules-users] [Fusion ] - Can we pass time value as a parameter in Temporal operator??
Maurico, Any plans in the future releases of Fusion?? Regds Chetan On Tue, Nov 3, 2009 at 12:40 AM, Greg Barton wrote: > You could do this by generating the rule text, but it would no be dynamic. > (i.e. you'd have to regenerate the rule and reload it into the ruleset.) > > --- On Mon, 11/2/09, Mauricio Salatino wrote: > > > From: Mauricio Salatino > > Subject: Re: [rules-users] [Fusion ] - Can we pass time value as a > parameter in Temporal operator?? > > To: "Rules Users List" > > Date: Monday, November 2, 2009, 11:45 AM > > no, right now that is not possible. > > > > 2009/11/2 Chetan Mahadev > > > > > > Hi, > > > > Is it possible to pass the time value as a > > "parameter" in temporal operator?? > > In the below example, I would like to pass $time as a > > variable, any integer value/String value representing > > time. ( ex: $time = 10s) > > > > > > > > > > > > Ex; > > $eventA : EventA( this after[ $time > > s ] $eventB ) > > > > > > > > > > > > > > > > > > > > ___ > > > > rules-users mailing list > > > > rules-users@lists.jboss.org > > > > https://lists.jboss.org/mailman/listinfo/rules-users > > > > > > > > > > > > -- > > - http://salaboy.wordpress.com > > - http://www.jbug.com.ar > > - Salatino "Salaboy" Mauricio - > > > > > > > > -Inline Attachment Follows- > > > > ___ > > 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 > ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] [Fusion ] - Can we pass time value as a parameter in Temporal operator??
Hi, Is it possible to pass the time value as a "parameter" in temporal operator?? In the below example, I would like to pass $time as a variable, any integer value/String value representing time. ( ex: $time = 10s) Ex; $eventA : EventA( this after[ $time s ] $eventB ) ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] Is there any way to hook-up Drools 4.0 RuleBase (session) to a Drools 5.0 KnowledgeBase (session) ??
Hi , We have been using drools 4.0 in our application. All the rules are loaded using RuleBase and PackageBuilder. The application is pretty old, and has got lot of work into it. Now we want to use Drools 5.0 CEP (Fusion) along with the old rules (based on drools 4.0). But the problem , is, how can we hook-up the old "RuleBase" based sessions with the "KnowledgeBase" sessions of Drools 5.0?? The use case is: 1.Fact enters the system ( asserted using Rulebase), is enriched by rules (Based on Drools 4.0) 2.The same fact will be treated as EVENT (for CEP), for further correlation of Events (facts) using KnowledgeBase as proposed i Drools 5.0. I am facing difficulty in hooking up the two sessions. Is there an way?? Following is the test i did. ( http://drools.pastebin.com/m7d6c613b) Can anybody help?? IN MY JAVA CODE 1. //load up the rulebase 2. RuleBase ruleBase = readRule(); // Read and load rules frm a packagebuilder() 3. StatefulSession rBaseSession = ruleBase.newStatefulSession(); 4. Message message = new Message(); 5. message.setMessage( "Hello World" ); 6. message.setStatus( Message.HELLO ); 7. rBaseSession.insert( message ); 8. 9. @@//Load KnoweledgeBase 10. KnowledgeBase kbase = loadRuleBase(); // I set options for EventProcessing in loadRuleBase() 11. KnowledgeSessionConfiguration conf = 12. KnowledgeBaseFactory.newKnowledgeSessionConfiguration(); 13. ((SessionConfiguration) conf).setClockType( ClockType.REALTIME_CLOCK ); 14. StatefulKnowledgeSessionkbaseSession = kbase.newStatefulKnowledgeSession(conf,null); 15. 16. rBaseSession.fireAllRules(); 17. IN MY RULE FILE 1. rule "Hello World" 2. when 3. $m : Message( status == Message.HELLO, message : message ) 4. then 5. System.out.println( message ); 6. Message message2 = new Message(); 7. message2.setMessage( "Hello World" ); 8. message2.setStatus( Message.HELLO ); 9. 10. WorkingMemoryEntryPoint eventsignaturestream = drools.getEntryPoint("EVENT SIGNATURE STREAM") ; // I Get a NULLPOINTER EXCEPTION here 11. eventsignaturestream.insert(message2); 12. 13. end ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
[rules-users] Drools-Fusion : Inserting an Event in to an "entry-point" stream in the RHS of a rule?? Pls help
Hi Can we insert an Event in the RHS part of a rule to an entry-point? basically i am trying to do this. Pls let me know if this is possible? if not any alternative approaches? Any example would be useful pls declare TransactionEvent @role( event ) end $tmp : TestClass() $tmp.message == "TRUE" then TransactionEvent ev1 = new TransactionEvent (); // This should be inserted in to an entry-pont "Temporal Reasoning" stream ev1.setMessage("Temporal Reasoning") insert (ev1) to entry-point "Temporal Reasoning" end rule "Temporal Reasoning" $tmp : TransactionEvent ( message== "Temporal Reasoning") from entry-point "Temporal Reasoning" then System.out.println("Rule fired due to entry point "); end Regds Chetan ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users