3 Replies Latest reply on Aug 30, 2006 5:30 AM by Ronald van Kuijk

    Using JbpmContext.save(processInstance), the TaskInstall don

    liu yan Newbie

      Hi All,

      These days i came accross a strange problem.
      First i create a process instance and return back the start task instance id.
      The code is shown in blow.

      Long lo = (Long)jbpmTemplate.execute(new JbpmCallback() {
      public Object doInJbpm(JbpmContext context) {
      ProcessInstance processInstance = context
      .newProcessInstance(processName);
      TaskInstance taskInstance = processInstance.getTaskMgmtInstance()
      .createStartTaskInstance();

      context.save(processInstance);

      return taskInstance.getId();
      }
      });
      return lo.longValue();



      After creating the process instance, i can't access the corresponding Token and TaskMgmtInstance from the TaskInstance which load by using the taskinstanceId return back from the above code.

      After checking the database, the relationship between the taskinstance and Token isn't persisted.

      My quesion is why after using JbpmContext.save(ProcessInstance),the relationship is lost.

      My environment is show below:
      1:Using spring module integrate the spring and jbpm.
      2:Using OpenSessionInView filter to keep one session per request.

      Thanks in advance.

      Best Wishes
      Lucas