Re: [rules-users] Decision tree availability
no :( Mark On 12 Jun 2013, at 06:18, mars137 atif.ta...@tcs.com wrote: Would decision tree be available in new version of drools i.e. Version 6? -- View this message in context: http://drools.46999.n3.nabble.com/Decision-tree-availability-tp4024261.html Sent from the Drools: User forum mailing list archive at Nabble.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
Re: [rules-users] Any way to make an AgendaEventListener always attach to any ksession from the same kbase?
Sorry I somehow thought you are one of the Drools team members (or a code contributor) because you are quite active on the forum. Oh and thanks for answering :) -- View this message in context: http://drools.46999.n3.nabble.com/Any-way-to-make-an-AgendaEventListener-always-attach-to-any-ksession-from-the-same-kbase-tp4025964p4026042.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Decision tree availability
DTs are unofficially available through PMML https://github.com/droolsjbpm/drools-chance/tree/master/drools-pmml The code currently works under 5.6, but I'll upgrade it for 6. Feel free to contact me with further questions or more detailed requirements Best Davide On 09/18/2013 11:25 PM, Mark Proctor wrote: no :( Mark On 12 Jun 2013, at 06:18, mars137 atif.ta...@tcs.com wrote: Would decision tree be available in new version of drools i.e. Version 6? -- View this message in context: http://drools.46999.n3.nabble.com/Decision-tree-availability-tp4024261.html Sent from the Drools: User forum mailing list archive at Nabble.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 ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Implementation of my use case - what am I doing wrong?
On 17/09/2013, Elran Dvir elr...@checkpoint.com wrote: Thanks again. I don't have startTimestamp and endTimestamp fields. I assume these fields are created on runtime bases on duration and timestamp attributes. Isn't it? Computationally, during the evaluation of the temporal operators. If I need to define them myself, what is the advantage of defining timestamp and duration attributes? Why would you want to do this? (My advice to replace the temporal operators by the equivalent expressions was meant as a debugging aid, to show you where the problem with this constraint is.) I'll try to organize the fourth question: I can't answer your question - it's impossible to tell what might happen without the code for CorrelatedEvent.java. For reproducing this, also the code for Log.java should be available. A couple of remarks: - Why do you use this complex declare? @timestamp( timestamp ) @duration( duration ) is sufficient. - Why do you use a Map and not simple fields? The DRL code is very confusing. - Why do you use two accumulate CE's when the set of matching elements is the same in both? -W I am trying to identify a port scan event: Basic event is connection log. For each combination of source_ip and destination_ip, detect a port scan event, if over 5 seconds there were more than 2 connection logs with different ports . The event will stay open for 10 seconds and an update will be sent for any new port detected. Every update will contain the count of connection logs combining it and their id (marker). This is my drl file: package test; import correlation.impl.drools.Log import correlation.impl.drools.CorrelatedEvent global correlation.server.EventsHandler externalEventsHandler; declare Log @role( event) end declare CorrelatedEvent @role( event) @timestamp( getTimestamp().getTime() ) @expires( 10s ) @duration( getDuration() ) end // this rule will create a Port Scan event if none exist for this group-by values rule Create Port Scan Event dialect java no-loop when $log : Log() from entry-point Log stream //get all the logs in the last 5 seconds accumulate( Log( this after[0s,5s] $log, fieldsMap.get(src) == $log.fieldsMap.get(src) , fieldsMap.get(dst) == $log.fieldsMap.get(dst), $port : fieldsMap.get(port)) from entry-point Log stream; $portSet : collectSet($port); $portSet.size 2 ) accumulate( Log( this after[0s,5s] $log, fieldsMap.get(src) == $log.fieldsMap.get(src) , fieldsMap.get(dst) == $log.fieldsMap.get(dst), $marker : fieldsMap.get(marker)) from entry-point Log stream; $markerSet : collectSet($marker)) not CorrelatedEvent(getName() == portScan , fieldsMap.get(src) == $log.fieldsMap.get(src) , fieldsMap.get(dst) == $log.fieldsMap.get(dst)) then System.out.println(drools.getRule().getName()); CorrelatedEvent $ce = new CorrelatedEvent(); $ce.setName(portScan); $ce.setEventsHandler(externalEventsHandler); $ce.setDurationInSec(10); $ce.fieldsMap.put(src, $log.fieldsMap.get(src)); $ce.fieldsMap.put(dst, $log.fieldsMap.get(dst)); $ce.endUpdate($markerSet); insert($ce); end rule Create Port Scan Event - update dialect java no-loop when $ce: CorrelatedEvent(getName() == portScan) accumulate( Log(fieldsMap.get(src) == $ce.fieldsMap.get(src) , fieldsMap.get(dst) == $ce.fieldsMap.get(dst) , $port : fieldsMap.get(port) , this after $ce.getStartTime() , this before $ce.getEndTime()) from entry-point Log stream; $portSet : collectSet($port); $portSet.size 0 ) accumulate( Log(fieldsMap.get(src) == $ce.fieldsMap.get(src) , fieldsMap.get(dst) == $ce.fieldsMap.get(dst) , $marker : fieldsMap.get(marker) , this after $ce.getStartTime() , this before $ce.getEndTime()) from entry-point Log stream; $markerSet : collectSet($marker)) then System.out.println(drools.getRule().getName()); modify( $ce ) {endUpdate($markerSet)} end I test it like this: I insert a connection log and fire the rules every second. I have 25 logs with the same src and dst, but each has different (serial) port and marker. So after 12-13 logs, I expect to identify a new event with another consecutive 3 logs. In each rule's RHS, I print the rule fired and the port set of logs triggering it. With existing implementation, I see the following output at 14th second: rule fired: Create Port Scan Event - update portSet: [10, 7, 6, 5, 4, 9, 8, 11, 12] rule fired: Create Port Scan Event portSet: [13, 11, 12]
Re: [rules-users] Dependency enumeration
Can anyone tell me if this issue fixed now ? -- View this message in context: http://drools.46999.n3.nabble.com/Dependency-enumeration-tp3245703p4026045.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Dependency enumeration
What does the JIRA say? Sent on the move On 19 Sep 2013 08:24, ashish6276 ashishkumarec...@gmail.com wrote: Can anyone tell me if this issue fixed now ? -- View this message in context: http://drools.46999.n3.nabble.com/Dependency-enumeration-tp3245703p4026045.html Sent from the Drools: User forum mailing list archive at Nabble.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
[rules-users] Optaplanner rules error
Hi, I have the following Drools rule in Optaplanner: rule oneShiftPerDay when $leftAssignment : ShiftAssignment($leftId : id, $employee : employee, $shiftDate : shiftDate, employee != null) $rightAssignment : ShiftAssignment(employee == $employee, shiftDate == $shiftDate, id $leftId) then scoreHolder.addHardConstraintMatch(kcontext, -1); end But when I run the solver I get the following error: 09:02:46.128 [main] ERROR o.d.c.k.b.impl.AbstractKieModule - Unable to build KieBaseModel:defaultKieBase Error importing : 'be.comp.permanenties.domain.solver.EmployeeAssignmentTotal' Error importing : 'be.comp.permanenties.domain.solver.EmployeeWorkSequence' Rule Compilation error : [Rule name='oneShiftPerDay'] be/comp/permanenties/solver/Rule_oneShiftPerDay544009415.java (2:220) : Only a type can be imported. be.comp.permanenties.domain.solver.EmployeeWorkSequence resolves to a package be/comp/permanenties/solver/Rule_oneShiftPerDay544009415.java (2:978) : Only a type can be imported. be.comp.permanenties.domain.solver.EmployeeAssignmentTotal resolves to a package How can I solve this error? Thanks. Kind regards, Nick [http://www.ocmwturnhout.be] http://www.ocmwturnhout.be Dit bericht is onderworpen aan de bepalingen van onze disclaimerhttp://www.ocmwturnhout.be/nl/content/2436 ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] latest event within a timeframe
It is a bug. The 2s delay is computed from the moment the rule is activated (by E2 at 12:01:50). rather than taking into account the correct zero timestamp ($event1). Thanks for reporting this, I'll open a JIRA Davide On 09/18/2013 12:29 PM, Wolfgang Laun wrote: Is the session being run via a single call to fireUntilHalt()? -W On 18/09/2013, Alexander Wolf m...@alexander-wolf.net wrote: [Drools Version 5.5.0 Final] Hey - I got an event E1 that is only valid, if the latest event E2 following E1 within 2 minutes has the value 1 -- I want have the rule fire 2 minutes after E1 but only if E1 is valid This is my rule: rule inform about E1 when //event (T1) is the initial trigger $event1 : Event(type == EventType.T1) //there is an event (T2) with value 0 between 0,2m after doorClosed $event2: Event(type == EventType.T2, value == 1, this after [0, 2m] $event1, $timestamp : timestamp) //there is no newer event (T2) within the timeframe not Measurement(type == EventType.T2, this after [0, 2m] $event1, timestamp $timestamp) then //print info log(drools, E1 valid); end An example of Events: 12:00:00 - E1 12:01:00 - E2 ( value = 0 ) 12:01:10 - E2 ( value = 0 ) 12:01:40 - E2 ( value = 0 ) 12:01:50 - E2 ( value = 1 ) 12:02:10 - E2 ( value = 0 ) I would expect the output: [log() does log the clock-time when my rule fires) 12:02:00 E1 valid But what I get is: 12:03:50 E1 valid So I see that the late coming E2 (@12:02:10) is correctly ignored, the rule result is basically correct, but the rule is fired much to late. (actually 2 minutes after $event2 and not as expected 2 minutes after $event1). Could someone give me a hint what I did wrong? Regards, Alex ___ 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] No errors thrown from KnowledgeAgent
It is a bug, the KA can detect compilation errors in resources, but will not capture runtime exceptions. I have opened a ticket, It will be fixed in 5.6 and 6.x Davide On 09/17/2013 01:51 PM, De Rooms Brecht wrote: Dear Drools users, Apparently it was not caused by the previously mentioned fix. Sometimes I still had a KnowledgeAgent in my server that doesn't respond anymore which seems to be caused by a mistake in the DRL file. I started to investigate the source code of KnowledgeAgentImpl and KnowledgeBaseImpl and recompiled them to add some prints. Finally I tracked it until AbstractRuleBase.addPackages. There is a giant Try-final block and I noticed by adding prints that it stopped somewhere in the middle. When it does fail, my KnowledgeAgent stops working completely. The try-final seemed to be the only place for me where an exception might be ignored so I added a catch clause. As a result, the error report of my drl file was nicely printed and my agent didn't crash: *org.drools.RuntimeDroolsException: Unable to resolve class 'int' for global 'RULES_MATCHED' at org.drools.common.AbstractRuleBase.mergePackage(AbstractRuleBase.java:818) at org.drools.common.AbstractRuleBase.addPackages(AbstractRuleBase.java:615) at org.drools.reteoo.ReteooRuleBase.addPackages(ReteooRuleBase.java:472) at org.drools.impl.KnowledgeBaseImpl.addKnowledgePackages(KnowledgeBaseImpl.java:153) at org.drools.agent.impl.KnowledgeAgentImpl.addResourcesToKnowledgeBase(KnowledgeAgentImpl.java:1173) at org.drools.agent.impl.KnowledgeAgentImpl.incrementalBuildResources(KnowledgeAgentImpl.java:1058) at org.drools.agent.impl.KnowledgeAgentImpl.buildKnowledgeBase(KnowledgeAgentImpl.java:738) at org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(KnowledgeAgentImpl.java:259) at org.drools.agent.impl.KnowledgeAgentImpl$ChangeSetNotificationDetector.run(KnowledgeAgentImpl.java:1357) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) at java.util.concurrent.FutureTask.run(FutureTask.java:166) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) at java.util.concurrent.FutureTask.run(FutureTask.java:166) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:722) * Maybe there is a reason for this missing catch so I am not sure whether I fixed it and broke something else ( eg. maybe I should undo a part of the operations before I continue). Is there anyone who knows this code and who can help me? Extra information: - I use Drools 5.5 from the Maven repository. - my agent configuration: agentConf.setProperty(drools.agent.newInstance, false); agentConf.setProperty(drools.agent.useKBaseClassLoaderForCompiling, true); Kind Regards, De Rooms Brecht Op 31/07/2013 14:45, De Rooms Brecht schreef: The bug was caused by one of the InputStreams that was not closed properly which caused the knowledgeAgent to block. I think my issues are solved now. Thanks for looking into this. Kind Regards, Op 31/07/2013 14:19, De Rooms Brecht schreef: Hello David and thanks for responding. I know it supports these event listeners and I use them. In my program, I have two knowledge agents and the first one (preprocessing) will read the file, preprocess a DRL and then write a second modified DRL file in a folder that is monitored by the second one. When I modify the original DRL file *(1.* in prints below*)* monitored by the preprocessing agent, everything works fine and the rule is triggered*(**2.)*. However, when I delete a file *(**3.)*, the knowledgeAgent just blocks after AfterChangeSetAppliedEvent and does not do anything anymore.. If I send new data in the knowledgeAgent it does not react anymore. I would expect to get a stacktrace of what went wrong but I do not get any info besides of the systemeventlistener or knowledgeagentlistener. Is there any way I can get a stacktrace? Kind Regards, De Rooms Brecht _*1. Resources Changed = Modified: [[FileResource file='knowledge\realtimeKnowledge\test.brules.testRule.drl']]*_ /eventListener 1::: ==[BeforeResourceProcessedEvent(RESOURCE_REMOVED): [FileResource file='knowledge\realtimeKnowledge\test.brules.testRule.drl']]// //eventListener 1::: ==[AfterResourceProcessedEvent(RESOURCE_REMOVED): [FileResource file='knowledge\realtimeKnowledge\test.brules.testRule.drl']]// //eventListener 1::: ==[AfterChangeSetProcessedEvent: ChangeSetImpl{resourcesRemoved=[], resourcesAdded=[], resourcesModified=[[FileResource
Re: [rules-users] latest event within a timeframe
Thank you Davide! For now, as a work around I split this into two rules, 1. rule : register the initial and second event and after (timer:2m) fire an internal event 2. rule : register internal event and then do the look behind (last 2 minutes) -- assert that the original event was valid -- this is not nice code and might cause further problems, so I am really looking forward to get a bug fix ;) @W: I call fireAllRules every time I insert a new event. (is this bad? This seemed to works better (in terms of predictability (unit tests...) of outcome) than all my attempts to use fireUntilHalt, w and w/o new Thread ...) especially with rules that use cron timers. On 19.09.2013, at 10:23, Davide Sottara dso...@gmail.com wrote: It is a bug. The 2s delay is computed from the moment the rule is activated (by E2 at 12:01:50). rather than taking into account the correct zero timestamp ($event1). Thanks for reporting this, I'll open a JIRA Davide On 09/18/2013 12:29 PM, Wolfgang Laun wrote: Is the session being run via a single call to fireUntilHalt()? -W On 18/09/2013, Alexander Wolf m...@alexander-wolf.net wrote: [Drools Version 5.5.0 Final] Hey - I got an event E1 that is only valid, if the latest event E2 following E1 within 2 minutes has the value 1 -- I want have the rule fire 2 minutes after E1 but only if E1 is valid This is my rule: rule inform about E1 when //event (T1) is the initial trigger $event1 : Event(type == EventType.T1) //there is an event (T2) with value 0 between 0,2m after doorClosed $event2: Event(type == EventType.T2, value == 1, this after [0, 2m] $event1, $timestamp : timestamp) //there is no newer event (T2) within the timeframe not Measurement(type == EventType.T2, this after [0, 2m] $event1, timestamp $timestamp) then //print info log(drools, E1 valid); end An example of Events: 12:00:00 - E1 12:01:00 - E2 ( value = 0 ) 12:01:10 - E2 ( value = 0 ) 12:01:40 - E2 ( value = 0 ) 12:01:50 - E2 ( value = 1 ) 12:02:10 - E2 ( value = 0 ) I would expect the output: [log() does log the clock-time when my rule fires) 12:02:00 E1 valid But what I get is: 12:03:50 E1 valid So I see that the late coming E2 (@12:02:10) is correctly ignored, the rule result is basically correct, but the rule is fired much to late. (actually 2 minutes after $event2 and not as expected 2 minutes after $event1). Could someone give me a hint what I did wrong? Regards, Alex ___ 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 signature.asc Description: Message signed with OpenPGP using GPGMail ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] No errors thrown from KnowledgeAgent
Dear Davide thank you very much for looking into this. I was wondering, are these kind of bugs also there in the commercial edition or is that a completely different implementation? Kind Regards, De Rooms Brecht Op 19/09/2013 10:46, Davide Sottara schreef: It is a bug, the KA can detect compilation errors in resources, but will not capture runtime exceptions. I have opened a ticket, It will be fixed in 5.6 and 6.x Davide On 09/17/2013 01:51 PM, De Rooms Brecht wrote: Dear Drools users, Apparently it was not caused by the previously mentioned fix. Sometimes I still had a KnowledgeAgent in my server that doesn't respond anymore which seems to be caused by a mistake in the DRL file. I started to investigate the source code of KnowledgeAgentImpl and KnowledgeBaseImpl and recompiled them to add some prints. Finally I tracked it until AbstractRuleBase.addPackages. There is a giant Try-final block and I noticed by adding prints that it stopped somewhere in the middle. When it does fail, my KnowledgeAgent stops working completely. The try-final seemed to be the only place for me where an exception might be ignored so I added a catch clause. As a result, the error report of my drl file was nicely printed and my agent didn't crash: *org.drools.RuntimeDroolsException: Unable to resolve class 'int' for global 'RULES_MATCHED' at org.drools.common.AbstractRuleBase.mergePackage(AbstractRuleBase.java:818) at org.drools.common.AbstractRuleBase.addPackages(AbstractRuleBase.java:615) at org.drools.reteoo.ReteooRuleBase.addPackages(ReteooRuleBase.java:472) at org.drools.impl.KnowledgeBaseImpl.addKnowledgePackages(KnowledgeBaseImpl.java:153) at org.drools.agent.impl.KnowledgeAgentImpl.addResourcesToKnowledgeBase(KnowledgeAgentImpl.java:1173) at org.drools.agent.impl.KnowledgeAgentImpl.incrementalBuildResources(KnowledgeAgentImpl.java:1058) at org.drools.agent.impl.KnowledgeAgentImpl.buildKnowledgeBase(KnowledgeAgentImpl.java:738) at org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(KnowledgeAgentImpl.java:259) at org.drools.agent.impl.KnowledgeAgentImpl$ChangeSetNotificationDetector.run(KnowledgeAgentImpl.java:1357) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) at java.util.concurrent.FutureTask.run(FutureTask.java:166) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) at java.util.concurrent.FutureTask.run(FutureTask.java:166) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:722) * Maybe there is a reason for this missing catch so I am not sure whether I fixed it and broke something else ( eg. maybe I should undo a part of the operations before I continue). Is there anyone who knows this code and who can help me? Extra information: - I use Drools 5.5 from the Maven repository. - my agent configuration: agentConf.setProperty(drools.agent.newInstance, false); agentConf.setProperty(drools.agent.useKBaseClassLoaderForCompiling, true); Kind Regards, De Rooms Brecht Op 31/07/2013 14:45, De Rooms Brecht schreef: The bug was caused by one of the InputStreams that was not closed properly which caused the knowledgeAgent to block. I think my issues are solved now. Thanks for looking into this. Kind Regards, Op 31/07/2013 14:19, De Rooms Brecht schreef: Hello David and thanks for responding. I know it supports these event listeners and I use them. In my program, I have two knowledge agents and the first one (preprocessing) will read the file, preprocess a DRL and then write a second modified DRL file in a folder that is monitored by the second one. When I modify the original DRL file *(1.* in prints below*)* monitored by the preprocessing agent, everything works fine and the rule is triggered*(**2.)*. However, when I delete a file *(**3.)*, the knowledgeAgent just blocks after AfterChangeSetAppliedEvent and does not do anything anymore.. If I send new data in the knowledgeAgent it does not react anymore. I would expect to get a stacktrace of what went wrong but I do not get any info besides of the systemeventlistener or knowledgeagentlistener. Is there any way I can get a stacktrace? Kind Regards, De Rooms Brecht _*1. Resources Changed = Modified: [[FileResource file='knowledge\realtimeKnowledge\test.brules.testRule.drl']]*_ /eventListener 1::: ==[BeforeResourceProcessedEvent(RESOURCE_REMOVED): [FileResource file='knowledge\realtimeKnowledge\test.brules.testRule.drl']]// //eventListener 1::: ==[AfterResourceProcessedEvent(RESOURCE_REMOVED): [FileResource file='knowledge\realtimeKnowledge\test.brules.testRule.drl']]// //
Re: [rules-users] latest event within a timeframe
Works incorrectly (as described by Alexander) with 5.1.1 and 5.3.0. The rule doesn't fire at all with 5.4.0 and 5.5.0. Using STREAM, fireUntilHalt(). -W On 19/09/2013, Alexander Wolf m...@alexander-wolf.net wrote: Thank you Davide! For now, as a work around I split this into two rules, 1. rule : register the initial and second event and after (timer:2m) fire an internal event 2. rule : register internal event and then do the look behind (last 2 minutes) -- assert that the original event was valid -- this is not nice code and might cause further problems, so I am really looking forward to get a bug fix ;) @W: I call fireAllRules every time I insert a new event. (is this bad? This seemed to works better (in terms of predictability (unit tests...) of outcome) than all my attempts to use fireUntilHalt, w and w/o new Thread ...) especially with rules that use cron timers. On 19.09.2013, at 10:23, Davide Sottara dso...@gmail.com wrote: It is a bug. The 2s delay is computed from the moment the rule is activated (by E2 at 12:01:50). rather than taking into account the correct zero timestamp ($event1). Thanks for reporting this, I'll open a JIRA Davide On 09/18/2013 12:29 PM, Wolfgang Laun wrote: Is the session being run via a single call to fireUntilHalt()? -W On 18/09/2013, Alexander Wolf m...@alexander-wolf.net wrote: [Drools Version 5.5.0 Final] Hey - I got an event E1 that is only valid, if the latest event E2 following E1 within 2 minutes has the value 1 -- I want have the rule fire 2 minutes after E1 but only if E1 is valid This is my rule: rule inform about E1 when //event (T1) is the initial trigger $event1 : Event(type == EventType.T1) //there is an event (T2) with value 0 between 0,2m after doorClosed $event2: Event(type == EventType.T2, value == 1, this after [0, 2m] $event1, $timestamp : timestamp) //there is no newer event (T2) within the timeframe not Measurement(type == EventType.T2, this after [0, 2m] $event1, timestamp $timestamp) then //print info log(drools, E1 valid); end An example of Events: 12:00:00 - E1 12:01:00 - E2 ( value = 0 ) 12:01:10 - E2 ( value = 0 ) 12:01:40 - E2 ( value = 0 ) 12:01:50 - E2 ( value = 1 ) 12:02:10 - E2 ( value = 0 ) I would expect the output: [log() does log the clock-time when my rule fires) 12:02:00 E1 valid But what I get is: 12:03:50 E1 valid So I see that the late coming E2 (@12:02:10) is correctly ignored, the rule result is basically correct, but the rule is fired much to late. (actually 2 minutes after $event2 and not as expected 2 minutes after $event1). Could someone give me a hint what I did wrong? Regards, Alex ___ 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
Re: [rules-users] Exception in thread main java.lang.ClassCastException: org.drools.io.impl.FileSystemResource cannot be cast to org.drools.io.InternalResource
This can happen, if you mix and match wrong versions of jars on your class path. Mark On 18 Sep 2013, at 18:10, Davide Sottara dso...@gmail.com wrote: Seems strange, since FileSystemResource implements InternalResource. Which version are you using? Davide On 09/18/2013 07:25 AM, poonam.lig...@wipro.com wrote: Hi, I am getting below error: Exception in thread main java.lang.ClassCastException: org.drools.io.impl.FileSystemResource cannot be cast to org.drools.io.InternalResource at org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:487) at org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:25) at SimpleRule.createKnowledgeBase(SimpleRule.java:87) at SimpleRule.main(SimpleRule.java:32) Can you please help. Its urgent. Thanks, Poonam. Please do not print this email unless it is absolutely necessary. The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. www.wipro.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 ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users