And now, I had another problem occurred .
When I finish the first task, the process can not start the second task
With the following pictures may be more clearer:
http://community.jboss.org/servlet/JiveServlet/downloadImage/16650/%E6%9C%AA%E5%91%BD%E5%90%8D.jpg
http://community.jboss.org/servlet/JiveServlet/downloadImage/16651/%E6%9C%AA%E5%91%BD%E5%90%8D.jpg
As far as I know, when the process is started, it will call WSHumanTaskHandler.executeWorkItem()
Meanwhile, when the task is ended, it will also to call WSHumanTaskHandler.executeWorkItem()
But the truth is it is not called
here is my codes:
/**
* start the process
*
* @param event
* @throws InterruptedException
*/
public void onTest1(Event event) throws InterruptedException {
try {
StatefulKnowledgeSession ksession = JbpmAPIUtil
.createKnowledgeSession("HelloProcess.bpmn");
// , "SampleHumanTaskFormVariables.bpmn"
logger = KnowledgeRuntimeLoggerFactory.newThreadedFileLogger(
ksession, "testlog", 1000);
ksession.getWorkItemManager().registerWorkItemHandler("Human Task",
new CommandBasedWSHumanTaskHandler(ksession));
dblogger = new JPAWorkingMemoryDbLogger(ksession);
Map<String, Object> params = new HashMap<String, Object>();
params.put("employee", "krisv");
ksession.startProcess("HelloProcess");
ksession.fireAllRules();
} catch (Throwable t) {
t.printStackTrace();
}
}
/**
* finish the task
*
* @param event
* @throws InterruptedException
*/
public void onTest2(Event event) throws InterruptedException {
try {
List<TaskSummary> tasks = JbpmAPIUtil
.getTasksAssignedAsPotentialOwner("krisv");
//Map data = new HashMap();
for (TaskSummary taskSummary : tasks) {
System.out.println(taskSummary.getId() + " : "
+ taskSummary.getName());
// data.put("priority", "High");
// data.put("modelNumber", "1234");
// data.put("quantity", "225");
JbpmAPIUtil.completeTask(taskSummary.getId(), null, "krisv");
}
dblogger.dispose();
logger.close();
} catch (Throwable t) {
t.printStackTrace();
}
}
http://community.jboss.org/servlet/JiveServlet/downloadImage/2-613368-16652/450-162/%E6%9C%AA%E5%91%BD%E5%90%8D.jpg