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");
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":
3、add the drl resource on java code ,then run code like before.
the result is console print nothing ? why ?
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.