Tobias Wittur [
http://community.jboss.org/people/tob1as] created the discussion
"Difficulties Invoking Rule Task"
To view the discussion, visit:
http://community.jboss.org/message/627082#627082
--------------------------------------------------------------
Hi,
I was trying to invoke a rule task within my process.
First, I took the example that was part of the unit test examples:
http://community.jboss.org/servlet/JiveServlet/showImage/2-627082-16997/C...
http://community.jboss.org/servlet/JiveServlet/downloadImage/2-627082-169...
The execution works fine.
I then added a human task node and a script task:
http://community.jboss.org/servlet/JiveServlet/showImage/2-627082-16998/C...
http://community.jboss.org/servlet/JiveServlet/downloadImage/2-627082-169...
Here, the script task prints a hello world, but then the process instance stops at the
rule task.
Does anyone know, why it is not running into the rule task? As I estimate, the rule task
node has to be active at the time the fireAllRules function is executed ?! But do I have
to manually fire that event everytime a rule has to be executed in a process?
The java looks as follows.
System.out.println("Loading process BPMN2-RuleTask.bpmn2");
KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
kbuilder.add(ResourceFactory.newClassPathResource("junit/BPMN2-RuleTask.bpmn2"),
ResourceType.BPMN2);
kbuilder.add(ResourceFactory.newClassPathResource("junit/BPMN2-RuleTask.drl"),
ResourceType.DRL);
KnowledgeBase kbase = kbuilder.newKnowledgeBase();
StatefulKnowledgeSession ksession = createKnowledgeSession(kbase);
ksession.getWorkItemManager().registerWorkItemHandler(
"Human Task",
new WSHumanTaskHandler()
);
List<String> list = new ArrayList<String>();
ksession.setGlobal("list", list);
ProcessInstance processInstance = ksession.startProcess("RuleTask");
ksession.fireAllRules();
Best regards,
Tobias
--------------------------------------------------------------
Reply to this message by going to Community
[
http://community.jboss.org/message/627082#627082]
Start a new discussion in jBPM at Community
[
http://community.jboss.org/choose-container!input.jspa?contentType=1&...]