Drools Flow - Human Task
by jawa
Hi,
I am developing a drools flow application and at one point of the flow I
want end user (User of my website) to reply to some questions one by one
i.e. I'll show them a question on a web page and they'll answer it then next
question etc. It has a flow sequence depending on the answers of questions.
e.g. If user replied 'No' to Q1 then go to Q5 else go to Q2 etc. So I want
my flow to stop for a user input when the flow reaches to the 'Ask question'
stage. I have read the drools flow documentation and it looks like there is
an option to use Human Task which will cause my flow to stop at that point
and wait for user input but for that I'll have to use Apache Mina server and
will need to claim tasks etc. But I don't want that because my front end
application is in php and backend (Drools flow) is in java and I connect
both using webservice. So I just want to ask my front end that ask question
then front end will reply with an answer that I want to feed to my flow then
flow will continue and decide which question to ask next. The website users
are anonymous it can be anyone answering the questions.
Can anyone please give me an idea how to achieve this using drools flow?
Thank you
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Drools-Flow-Human-Tas...
Sent from the Drools - User mailing list archive at Nabble.com.
15 years, 7 months
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, 7 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, 7 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, 7 months