0 Replies Latest reply on May 30, 2013 4:02 AM by eden li

    Why the first User Task was executed by ksession.startProcess

    eden li Newbie

      Hi JBPMers.


      When I create a process within three user task nodes and run it, I found the first user task was executed by the method startprocess and no task record information was generated. Another problem is after three user tasks were finished. Another new task record with ready status was generated.


      I have two problems of it.

      1. If the first user task executed by startprocess is resonable, how to find the relavent task infomation. There are no record generated in task table.

      2. After the last user task was executed. Why also another task record was generated with ready status. The workflow should have been finished. I think it results to the main function (testing function) can be finished in eclipse.


      So could please tell me hwo to avoid the problem. Following are my relevant sources and BPMN2 file.


      private static KnowledgeBase readKnowledgeBase() {

                          KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();

                          kbuilder.add(ResourceFactory.newFileResource("D:\\workSpace\\PoC2\\ExperimentOA\\bin\\MainBusinessProcess.bpmn2"), ResourceType.BPMN2);

                          return kbuilder.newKnowledgeBase();



      public static StatefulKnowledgeSession newKsession() {

                          StatefulKnowledgeSession ksession;

                          try {

                            KnowledgeBase kbase = readKnowledgeBase();

                            ksession = JBPMHelper.newStatefulKnowledgeSession(kbase);

                          } catch(Exception e) {

                                    throw new RuntimeException(e);


                          return ksession;



      public static void startProcess(StatefulKnowledgeSession ksession, String s, Map params) {

                          HashMap<String, Object> results = new HashMap<String, Object>();

                          params.put("results", results);

                          params.put("ksessionId", String.valueOf(ksession.getId()));

                          ksession.startProcess(s, params);