5 Replies Latest reply on Aug 21, 2007 11:59 AM by jeffcwang

    task instance in start state

    jywu

      hi,
      I went through the jbpm user guide about task instance,
      it's saying

      Task instances are typically created by the process execution entering a task-node

      Is that different from the task in start state?
      'Cause when I invoke this method
      instance.getTaskMgmtInstance().getTaskInstances().iterator().next();
      

      right after I create the process instance, it will throw a NullPointerException.
      If the task instance won't be created automatically in start state, can I create it somehow manually? or I misunderstand somewhere above?
      Here is my start state definition:
      <start-state name="draft">
       <task name="making a draft" swimlane="writer">
       <assignment class='com.test.WriterAssignmentHandler' />
       </task>
       <transition to="review" name="submit"></transition>
      </start-state>
      


        • 1. Re: task instance in start state
          vtysh

          How i know start-state currently doesn't support a swimlanes

          • 2. Re: task instance in start state
            kukeltje

            it is indeed not in the docs and maybe it should be possible to have a swimlane at a start task. IMO it should be possible. So please file a jira issue for this.

            • 3. Re: task instance in start state
              cheets

              Hi! I also faced the same issue. (unexpected null pointer on processInstance.getTaskManagerInstance() when the task has only been assigned.) I couldnt find this reported in jira.. maybe my search is not good ;)
              could you please post the jira link here?
              thanks!

              • 4. Re: task instance in start state
                cheets

                Also, a workwaround to that will be very much appreciated.
                (ie, how to iterate over taskinstances of a processinstance, when we dont know whether the task has started or not)
                thanks again!

                • 5. Re: task instance in start state
                  jeffcwang

                  As i recall, tasks should be initiated in the start state. I've seen it work in 3.2.1, although i didn't programatically invoke it. I just used the web-console. A workaround is that you can have a start state that does nothing but transition to your first task node. With that workaround, you would also be able to use swimlanes in the first task node.