Implementing Timers With Drools Persistence Enabled
by nanic23
Hi All,
I was able to implement some timers and they behave as expected until I
enable persistence. Timers work (get triggered) when creating the
StatefulKnowledgeSession by kbase.newStatefulKnowledgeSession() but they do
NOT work (do not get triggered) when creating the StatefulKnowledgeSession
by JPAKnowledgeService.newStatefulKnowledgeSession(kbase, null, env);
I am calling ksession.fireUntilHalt() from within a new thread and all that.
The problem is not getting timers to work, as I have already accomplished
this, but the problem is rather getting them to work with persistence
enabled.
- Has anyone implemented timers while using (having enabled) persistence?
- Did you experience any problems such as timers not triggering?
- If so, have you found a work around you could share?
The timers are being implemented in ruleflow (DRF) and I'm using drools
5.1.0
Any comments are welcome.
Thanks,
Nick.
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Implementing-Timers-W...
Sent from the Drools - User mailing list archive at Nabble.com.
15 years, 5 months
Still getting an EvalConditionNode ClassCastException
by Paul Ryan
We're still getting a class cast exception for beta and eval memory (exception below). It is a different location and the opposite direction of the exception cast from JBRULES-1719.
The rule we ran was:
/**
* Load the smgl transform
*/
rule "Load Transform"
when
$fact : ParametersFact(
doc != "dmodule",
$xml : xml != null,
noopResponse == true,
eval(XPathUtil.selectElement($xml,"/*/transformLog//transform[name='s1000dv3']")==null),
flags['loadedS1000Dv3']!=true,
eval(XPathUtil.selectElement($xml,"/*/transformLog//transform[name='detect']/results[result='text/xml']")!=null)
)
$importUtil : RuleImportUtil()
$model : EditionsRulesJobRunner(stop==false,interrupt==false)
then
Vector<String> libraries = new Vector<String>();
libraries.add("lib");
String documentType = "dmodule";
String fragmentType = "dmodule";
$importUtil.importRules(kcontext,"transformCmd",documentType,fragmentType,libraries);
$fact.getFlags().put("loadedS1000Dv3",true);
end
The thing of consequence here is the importRules call which modifies the kcontext and acts as a dynamic include (e.g. it imports new rules).
The exception received is:
INFO | 2010/07/19 17:07:29 | jvm 1 | 2010-07-19 17:07:29,743 INFO com.infotrustgroup.restless.server.ThreadedService:An exception was trapped in com.infotrustgroup.jobs.services.auth.EditionsRulesJobRunner
INFO | 2010/07/19 17:07:29 | jvm 1 | org.drools.runtime.rule.ConsequenceException: java.lang.ClassCastException: org.drools.reteoo.BetaMemory cannot be cast to org.drools.reteoo.EvalConditionNode$EvalMemory
INFO | 2010/07/19 17:07:29 | jvm 1 | at org.drools.runtime.rule.impl.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:23)
INFO | 2010/07/19 17:07:29 | jvm 1 | at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:943)
INFO | 2010/07/19 17:07:29 | jvm 1 | at org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:885)
INFO | 2010/07/19 17:07:29 | jvm 1 | at org.drools.common.DefaultAgenda.fireAllRules(DefaultAgenda.java:1086)
INFO | 2010/07/19 17:07:29 | jvm 1 | at org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:660)
INFO | 2010/07/19 17:07:29 | jvm 1 | at org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:627)
INFO | 2010/07/19 17:07:29 | jvm 1 | at org.drools.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:183)
INFO | 2010/07/19 17:07:29 | jvm 1 | at com.infotrustgroup.rules.engine.RulesManager.runRules(RulesManager.java:363)
INFO | 2010/07/19 17:07:29 | jvm 1 | at com.infotrustgroup.util.rules.RuleFileUtil.runRules(RuleFileUtil.java:385)
INFO | 2010/07/19 17:07:29 | jvm 1 | at com.infotrustgroup.util.rules.RuleFileUtil.runRules(RuleFileUtil.java:349)
INFO | 2010/07/19 17:07:29 | jvm 1 | at com.infotrustgroup.util.rules.RuleRunner.run(RuleRunner.java:395)
INFO | 2010/07/19 17:07:29 | jvm 1 | at com.infotrustgroup.util.rules.RuleRunner.call(RuleRunner.java:193)
INFO | 2010/07/19 17:07:29 | jvm 1 | at com.infotrustgroup.jobs.services.auth.EditionsRulesJobRunner.runRules(EditionsRulesJobRunner.java:87)
INFO | 2010/07/19 17:07:29 | jvm 1 | at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
INFO | 2010/07/19 17:07:29 | jvm 1 | at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
INFO | 2010/07/19 17:07:29 | jvm 1 | at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
INFO | 2010/07/19 17:07:29 | jvm 1 | at java.lang.reflect.Method.invoke(Method.java:597)
INFO | 2010/07/19 17:07:29 | jvm 1 | at com.infotrustgroup.restless.server.ThreadedService.runServiceMethod(ThreadedService.java:845)
INFO | 2010/07/19 17:07:29 | jvm 1 | Caused by: java.lang.ClassCastException: org.drools.reteoo.BetaMemory cannot be cast to org.drools.reteoo.EvalConditionNode$EvalMemory
INFO | 2010/07/19 17:07:29 | jvm 1 | at org.drools.reteoo.EvalConditionNode.retractLeftTuple(EvalConditionNode.java:199)
INFO | 2010/07/19 17:07:29 | jvm 1 | at org.drools.reteoo.ObjectTypeNode.retractObject(ObjectTypeNode.java:239)
INFO | 2010/07/19 17:07:29 | jvm 1 | at org.drools.reteoo.EntryPointNode.retractObject(EntryPointNode.java:195)
INFO | 2010/07/19 17:07:29 | jvm 1 | at org.drools.common.AbstractWorkingMemory.update(AbstractWorkingMemory.java:1416)
INFO | 2010/07/19 17:07:29 | jvm 1 | at org.drools.common.AbstractWorkingMemory.update(AbstractWorkingMemory.java:1350)
INFO | 2010/07/19 17:07:29 | jvm 1 | at org.drools.impl.StatefulKnowledgeSessionImpl.update(StatefulKnowledgeSessionImpl.java:231)
INFO | 2010/07/19 17:07:29 | jvm 1 | at com.infotrustgroup.rules.engine.RulesManager$InnerPropertyChangeListener.propertyChange(RulesManager.java:467)
INFO | 2010/07/19 17:07:29 | jvm 1 | at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:339)
INFO | 2010/07/19 17:07:29 | jvm 1 | at com.infotrustgroup.util.collections.BoundMap.put(BoundMap.java:67)
INFO | 2010/07/19 17:07:29 | jvm 1 | at com.infotrustgroup.what.Rule_Load_ATAXML_Transform_0.consequence(Rule_Load_ATAXML_Transform_0.java:28)
INFO | 2010/07/19 17:07:29 | jvm 1 | at com.infotrustgroup.what.Rule_Load_ATAXML_Transform_0ConsequenceInvoker.evaluate(Rule_Load_ATAXML_Transform_0ConsequenceInvoker.java:28)
INFO | 2010/07/19 17:07:29 | jvm 1 | at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:934)
INFO | 2010/07/19 17:07:29 | jvm 1 | ... 16 more
INFO | 2010/07/19 17:07:29 | jvm 1 | org.drools.runtime.rule.ConsequenceException: java.lang.ClassCastException: org.drools.reteoo.BetaMemory cannot be cast to org.drools.reteoo.EvalConditionNode$EvalMemory
INFO | 2010/07/19 17:07:29 | jvm 1 | at org.drools.runtime.rule.impl.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:23)
INFO | 2010/07/19 17:07:29 | jvm 1 | at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:943)
INFO | 2010/07/19 17:07:29 | jvm 1 | at org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:885)
INFO | 2010/07/19 17:07:29 | jvm 1 | at org.drools.common.DefaultAgenda.fireAllRules(DefaultAgenda.java:1086)
INFO | 2010/07/19 17:07:29 | jvm 1 | at org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:660)
INFO | 2010/07/19 17:07:29 | jvm 1 | at org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:627)
INFO | 2010/07/19 17:07:29 | jvm 1 | at org.drools.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:183)
INFO | 2010/07/19 17:07:29 | jvm 1 | at com.infotrustgroup.rules.engine.RulesManager.runRules(RulesManager.java:363)
INFO | 2010/07/19 17:07:29 | jvm 1 | at com.infotrustgroup.util.rules.RuleFileUtil.runRules(RuleFileUtil.java:385)
INFO | 2010/07/19 17:07:29 | jvm 1 | at com.infotrustgroup.util.rules.RuleFileUtil.runRules(RuleFileUtil.java:349)
INFO | 2010/07/19 17:07:29 | jvm 1 | at com.infotrustgroup.util.rules.RuleRunner.run(RuleRunner.java:395)
INFO | 2010/07/19 17:07:29 | jvm 1 | at com.infotrustgroup.util.rules.RuleRunner.call(RuleRunner.java:193)
INFO | 2010/07/19 17:07:29 | jvm 1 | at com.infotrustgroup.jobs.services.auth.EditionsRulesJobRunner.runRules(EditionsRulesJobRunner.java:87)
INFO | 2010/07/19 17:07:29 | jvm 1 | at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
INFO | 2010/07/19 17:07:29 | jvm 1 | at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
INFO | 2010/07/19 17:07:29 | jvm 1 | at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
INFO | 2010/07/19 17:07:29 | jvm 1 | at java.lang.reflect.Method.invoke(Method.java:597)
INFO | 2010/07/19 17:07:29 | jvm 1 | at com.infotrustgroup.restless.server.ThreadedService.runServiceMethod(ThreadedService.java:845)
INFO | 2010/07/19 17:07:29 | jvm 1 | Caused by: java.lang.ClassCastException: org.drools.reteoo.BetaMemory cannot be cast to org.drools.reteoo.EvalConditionNode$EvalMemory
INFO | 2010/07/19 17:07:29 | jvm 1 | at org.drools.reteoo.EvalConditionNode.retractLeftTuple(EvalConditionNode.java:199)
INFO | 2010/07/19 17:07:29 | jvm 1 | at org.drools.reteoo.ObjectTypeNode.retractObject(ObjectTypeNode.java:239)
INFO | 2010/07/19 17:07:29 | jvm 1 | at org.drools.reteoo.EntryPointNode.retractObject(EntryPointNode.java:195)
INFO | 2010/07/19 17:07:29 | jvm 1 | at org.drools.common.AbstractWorkingMemory.update(AbstractWorkingMemory.java:1416)
INFO | 2010/07/19 17:07:29 | jvm 1 | at org.drools.common.AbstractWorkingMemory.update(AbstractWorkingMemory.java:1350)
INFO | 2010/07/19 17:07:29 | jvm 1 | at org.drools.impl.StatefulKnowledgeSessionImpl.update(StatefulKnowledgeSessionImpl.java:231)
INFO | 2010/07/19 17:07:29 | jvm 1 | at com.infotrustgroup.rules.engine.RulesManager$InnerPropertyChangeListener.propertyChange(RulesManager.java:467)
INFO | 2010/07/19 17:07:29 | jvm 1 | at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:339)
INFO | 2010/07/19 17:07:29 | jvm 1 | at com.infotrustgroup.util.collections.BoundMap.put(BoundMap.java:67)
INFO | 2010/07/19 17:07:29 | jvm 1 | at com.infotrustgroup.what.Rule_Load_ATAXML_Transform_0.consequence(Rule_Load_ATAXML_Transform_0.java:28)
INFO | 2010/07/19 17:07:29 | jvm 1 | at com.infotrustgroup.what.Rule_Load_ATAXML_Transform_0ConsequenceInvoker.evaluate(Rule_Load_ATAXML_Transform_0ConsequenceInvoker.java:28)
INFO | 2010/07/19 17:07:29 | jvm 1 | at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:934)
INFO | 2010/07/19 17:07:29 | jvm 1 | ... 16 more
INFO | 2010/07/19 17:07:29 | jvm 1 | 2010-07-19 17:07:29,759 FATAL com.infotrustgroup.jobs.services.auth.EditionsRulesJobRunner:Worker service threw an unexpected exception.
INFO | 2010/07/19 17:07:29 | jvm 1 | org.drools.runtime.rule.ConsequenceException: java.lang.ClassCastException: org.drools.reteoo.BetaMemory cannot be cast to org.drools.reteoo.EvalConditionNode$EvalMemory
INFO | 2010/07/19 17:07:29 | jvm 1 | at org.drools.runtime.rule.impl.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:23)
INFO | 2010/07/19 17:07:29 | jvm 1 | at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:943)
INFO | 2010/07/19 17:07:29 | jvm 1 | at org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:885)
INFO | 2010/07/19 17:07:29 | jvm 1 | at org.drools.common.DefaultAgenda.fireAllRules(DefaultAgenda.java:1086)
INFO | 2010/07/19 17:07:29 | jvm 1 | at org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:660)
INFO | 2010/07/19 17:07:29 | jvm 1 | at org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:627)
INFO | 2010/07/19 17:07:29 | jvm 1 | at org.drools.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:183)
INFO | 2010/07/19 17:07:29 | jvm 1 | at com.infotrustgroup.rules.engine.RulesManager.runRules(RulesManager.java:363)
INFO | 2010/07/19 17:07:29 | jvm 1 | at com.infotrustgroup.util.rules.RuleFileUtil.runRules(RuleFileUtil.java:385)
INFO | 2010/07/19 17:07:29 | jvm 1 | at com.infotrustgroup.util.rules.RuleFileUtil.runRules(RuleFileUtil.java:349)
INFO | 2010/07/19 17:07:29 | jvm 1 | at com.infotrustgroup.util.rules.RuleRunner.run(RuleRunner.java:395)
INFO | 2010/07/19 17:07:29 | jvm 1 | at com.infotrustgroup.util.rules.RuleRunner.call(RuleRunner.java:193)
INFO | 2010/07/19 17:07:29 | jvm 1 | at com.infotrustgroup.jobs.services.auth.EditionsRulesJobRunner.runRules(EditionsRulesJobRunner.java:87)
INFO | 2010/07/19 17:07:29 | jvm 1 | Caused by: java.lang.ClassCastException: org.drools.reteoo.BetaMemory cannot be cast to org.drools.reteoo.EvalConditionNode$EvalMemory
INFO | 2010/07/19 17:07:29 | jvm 1 | at org.drools.reteoo.EvalConditionNode.retractLeftTuple(EvalConditionNode.java:199)
INFO | 2010/07/19 17:07:29 | jvm 1 | at org.drools.reteoo.ObjectTypeNode.retractObject(ObjectTypeNode.java:239)
INFO | 2010/07/19 17:07:29 | jvm 1 | at org.drools.reteoo.EntryPointNode.retractObject(EntryPointNode.java:195)
INFO | 2010/07/19 17:07:29 | jvm 1 | at org.drools.common.AbstractWorkingMemory.update(AbstractWorkingMemory.java:1416)
INFO | 2010/07/19 17:07:29 | jvm 1 | at org.drools.common.AbstractWorkingMemory.update(AbstractWorkingMemory.java:1350)
INFO | 2010/07/19 17:07:29 | jvm 1 | at org.drools.impl.StatefulKnowledgeSessionImpl.update(StatefulKnowledgeSessionImpl.java:231)
INFO | 2010/07/19 17:07:29 | jvm 1 | at com.infotrustgroup.rules.engine.RulesManager$InnerPropertyChangeListener.propertyChange(RulesManager.java:467)
INFO | 2010/07/19 17:07:29 | jvm 1 | at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:339)
INFO | 2010/07/19 17:07:29 | jvm 1 | at com.infotrustgroup.util.collections.BoundMap.put(BoundMap.java:67)
INFO | 2010/07/19 17:07:29 | jvm 1 | at com.infotrustgroup.what.Rule_Load_ATAXML_Transform_0.consequence(Rule_Load_ATAXML_Transform_0.java:28)
INFO | 2010/07/19 17:07:29 | jvm 1 | at com.infotrustgroup.what.Rule_Load_ATAXML_Transform_0ConsequenceInvoker.evaluate(Rule_Load_ATAXML_Transform_0ConsequenceInvoker.java:28)
INFO | 2010/07/19 17:07:29 | jvm 1 | at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:934)
INFO | 2010/07/19 17:07:29 | jvm 1 | ... 11 more
Point of speculation:
When looking at the latest code on trunk I would believe this is not fixed as the line pointed to here has not changed (the place where this line exists has changed but not the code see fisheye at http://fisheye.jboss.org/browse/JBossRules/trunk/drools-core/src/main/jav... and where the lefthand side was 199 for 5.0.1 it is still the same code in the latest svn revision (now line 229).
-- Paul Ryan
15 years, 5 months
Drools 5.1.0CR1
by Juan Ignacio Barisich
Hello everyone.
I'm working on a research about migration from OSWorklow to DroolsFlow.
Among other things, I need spring integration support. As I know, this
feature will be supported in the 5.1.0CR1 version of Drools. Do you know
when this version will be released? On
https://jira.jboss.org/browse/JBRULESthere isn't an expected date for
this version.
Thanks in advance.
Juan Barisich
15 years, 5 months
Handling Many Literal Matches Rules
by rodih
Hi,
I have the following scenario:
List 1 of string values: "A", "B", "C"
List 2 of string values: "X", "Y", "Z"
Some text that might look like "AFFG DDGT AY FDD" (Important value in the
text is AY)
I need a rule for every string value from List 1 combined with every value
from List 2 for example:
rule
when text matches "AX"
then
end rule
rule
when text matches "AY"
then
end rule
rule
when text matches "AZ"
then
end rule
rule
when text matches "BX"
then
end rule
rule
when text matches "BY"
then
end rule
...
You get the idea ;-)
The lists might be big (50 entries each) and will be change constantly out
side the application.
What is the best approach for this kind of rules?
Thanks,
Rod
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Handling-Many-Literal...
Sent from the Drools - User mailing list archive at Nabble.com.
15 years, 5 months