-
1. Re: can i use rule task in embedded sub-process?
hardawaycg Jan 12, 2012 10:39 PM (in response to hardawaycg)sorry,after kinds of test,i found this is not because of embedded sub-process,but signal event.
rule task doesn't work on a flow file if these is signal event,this is my test case:
scene1: just like below,it works:
with java code like this,the console print run,it works.
ProcessInstance process = ksession.startProcess("test2Flow");
ksession.fireAllRules();
ksession.signalEvent("event1", null,process.getId());
scene2:
1、replace the script task with a rule task,and set ruleflowgroup as sub1
2、create a drl file and write a rule name "rule1":
rule "rule1"
ruleflow-group "sub1"
when
then
System.out.println("sub1");
end
3、add the drl resource on java code ,then run code like before.
the result is console print nothing ? why ?
-
2. Re: can i use rule task in embedded sub-process?
eaa Jan 13, 2012 3:24 AM (in response to hardawaycg)According to the information you have exposed, I can state this: After you call ksession.signalEven(), the process continues its execution and reaches the Rule Task node. At this point, the rule is activated (check the output log to check this) and the process execution stops returning to the line after ksession.signalEvent(). At this point you need to tell the session to execute all activated rules: ksession.fireAllRules(). When fireAllRules() gets executed, the process execution continues and reaches the end node.