[jboss-user] [jBPM] - Re: How to finish the processInstance
RuiHua Tang
do-not-reply at jboss.com
Mon Jul 4 23:10:25 EDT 2011
RuiHua Tang [http://community.jboss.org/people/trh3037] created the discussion
"Re: How to finish the processInstance"
To view the discussion, visit: http://community.jboss.org/message/613368#613368
--------------------------------------------------------------
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/showImage/16650/%E6%9C%AA%E5%91%BD%E5%90%8D.jpg http://community.jboss.org/servlet/JiveServlet/downloadImage/16650/%E6%9C%AA%E5%91%BD%E5%90%8D.jpg
http://community.jboss.org/servlet/JiveServlet/showImage/16651/%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/showImage/2-613368-16652/%E6%9C%AA%E5%91%BD%E5%90%8D.jpg http://community.jboss.org/servlet/JiveServlet/downloadImage/2-613368-16652/450-162/%E6%9C%AA%E5%91%BD%E5%90%8D.jpg
+
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/613368#613368]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20110704/5fe1748b/attachment-0001.html
More information about the jboss-user
mailing list