[jboss-user] [jBPM] - Why the first User Task was executed by ksession.startProcess

eden li do-not-reply at jboss.com
Wed May 29 06:50:57 EDT 2013

eden li [https://community.jboss.org/people/eden_li] created the discussion

"Why the first User Task was executed by ksession.startProcess"

To view the discussion, visit: https://community.jboss.org/message/820072#820072

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. It results to the case that still three task records has been generated. But only first two records has been completed and the last record was in Ready status. Also the first two records was completed by the next two user task's node. Then the first user task's information like owner_id and initiator_id totally can not be found in those task records.

So could please tell me hwo to avoid the first user task executed by the method startprocess from ksession. I think it should be more resonable. 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);

Reply to this message by going to Community

Start a new discussion in jBPM at Community

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20130529/9ace009c/attachment.html 

More information about the jboss-user mailing list