-
1. RuleTask example
jmfaerman Mar 7, 2011 8:11 AM (in response to aminmc)Check that:
1) You are calling ksession.fireAllRules() or ksession.fireUntilHalt() so that the rules fires
2) The WorkItem inserted before the rules fire
Hope it helps
-
2. RuleTask example
harjotnarula09 Mar 7, 2011 1:31 PM (in response to aminmc)I think there is a defect in drools 5.1.1 where the following is removed from the process XML. You can try using jBPM 5.0 or 5.1-snapshot, both have this issue resolved.
xmlns:g="http://www.jboss.org/drools/flow/gpd"
-
3. RuleTask example
aminmc Mar 7, 2011 2:27 PM (in response to jmfaerman)Hi
Thanks for your reply. The following shows my test case:
KnowledgeBase kbase = createKnowledgeBase("bpmn/sample.bpmn");
StatefulKnowledgeSession ksession = createKnowledgeSession(kbase);
ProcessInstance processInstance = ksession.startProcess("Minimal");
ksession.signalEvent("completeEvent","A", processInstance.getId());
assertProcessInstanceNotCompleted(processInstance.getId(), ksession);
The work item is created during the process execution so do I still need to insert the work item via ksession.insert(..) also where do I invoke ksession.fireAllRules(..) method?
Thanks
-
4. Re: RuleTask example
bpmn2user Mar 7, 2011 2:41 PM (in response to aminmc)You can do in the following sequence:
ksession.insert(..);
ksession.startProcess(....);
ksession.fireAllRules();
-