2 Replies Latest reply on Aug 29, 2006 7:10 PM by Ronald van Kuijk

    Problem creating Process Instance and Tasks

    John Menke Newbie

      I am trying to creat a simple web application that demonstrates moving a token through a process and assigning users to tasks during the process.

      I am using the Spring Modules package to configure my JBPM engine. When i try to create a processInstance and signal the token it appears that my Taskinstance is not getting creating for my first task.

      Here is my simple process Definition:

      <?xml version="1.0" encoding="UTF-8"?>

      <process-definition name="3step">

      <!-- START-STATE -->
      <start-state name="start">


      <!-- NODES -->
      <end-state name="end"/>
      <task-node name="task1">

      <task-node name="task2">

      <task-node name="task3">



      Here is the code in my servlet:

      webContext = WebApplicationContextUtils

      jbpmConfiguration = (JbpmConfiguration) webContext

      JbpmTemplate jbpmTemplate = (JbpmTemplate) webContext

      ProcessDefinition pd = jbpmTemplate.getProcessDefinition();

      ProcessInstance processInstance = new ProcessInstance(pd);

      Token token = processInstance.getRootToken();


      TaskInstance task1 = getTaskInstanceByTaskName(processInstance, "task1");


      private TaskInstance getTaskInstanceByTaskName(ProcessInstance processInstance, String taskName){

      Collection taskInstances = processInstance
      // this collection is always null????

      Iterator i = taskInstances.iterator();

      TaskInstance currentTask = null;

      while (i.hasNext()){
      TaskInstance task = (TaskInstance)i.next();

      if (task.getName().equals(taskName)){
      currentTask = task;

      return currentTask;


      Can anyone shed some light on why there is no task instance for this processInstance after the token.signal() is processed?