2 Replies Latest reply on Jun 16, 2008 8:37 PM by wjq

    why swimlane in start-task not assigned ?

    wjq Newbie

      I am studying jbpm(v3.2.2). I made a simple process as following.To capture who kick start a instance of it ,I set a swimlane in the start-task.

      <?xml version="1.0" encoding="UTF-8"?>
      <process-definition xmlns="urn:jbpm.org:jpdl-3.2" name="webflow">
       <swimlane name="initiator" />
       <start-state name="start-state1">
       <task swimlane="initiator" />
       <transition to="waitDecision">
       </start-state>
       ... ...


      The following is the test code to create an instance of it
      ... ...
      context.setActorId("john");
      GraphSession gs = context.getGraphSession();
      ProcessDefinition pdf = gs.findLatestProcessDefinition("webflow");
      ProcessInstance pi = pdf.createProcessInstance();
      pi.signal();
      ... ...

      As the code above shows,I set the actor to "john".
      After run it,I find jbpm do create a process instance in database.but another test code of
      // pi is an instance loaded from db.
      pi.getTaskMgmtInstance().getSwimlaneInstance("initiator");
      get null ! The expected result should not be null,and the pi.getTaskMgmtInstance().getSwimlaneInstance("initiator").getActorId() should be john.

      Why ?

        • 1. Re: why swimlane in start-task not assigned ?
          Ronald van Kuijk Master

          note: I did not read the full post

          answer: it was designed that way. There is a jira issue to change this (you could have found that yourself ;-) )

          • 2. Re: why swimlane in start-task not assigned ?
            wjq Newbie

            kukeltje,thanks for your response.

            I found the problem can be solved by explicitly creating a start task:

            ProcessInstance pi = pdf.createProcessInstance();
            pi.getTaskMgmtInstance().createStartTaskInstance();

            only this way the jbpm will create a initiator swimlane instance.

            there must be some consideration of jbpm team which make them not let jbpm create the initiator swimlance by just start the new process instance.
            Anyway,create start task is not a big trouble and i will do so.