Uploaded image for project: 'jBPM'
  1. jBPM
  2. JBPM-2135

Next TaskInstance is not created

    XMLWordPrintable

Details

    Description

      I have a process definition with linear task nodes of about 11 each containing a single task, to finish the task & start the next task(if the flow is not @ the end), as described in the jBPM docs, I usually get the taskinstance by the id and invoke end() to finish that task & the next task's instance gets auto created... however, at times the next task is not created for unknown reasons(no exception thrown!), even when the taskinstance over which the end() is invoked is tagged by jBPM as ended...

      This happens unpredictably!!!

      The only work around i have as of now is to explicitly make the so pitifully ended task open by setting the taskinstance's end_ value to null and again call the end()...

      As of now this is how I'm finding whether the next task is successfully created or not...

      taskInstance.end();
      getJbpmContext().save(taskInstance);

      flushJbpmSession();

      boolean next = true;
      if(taskInstance.getProcessInstance().getEnd() == null) {
      Collection<TaskInstance> list = (Collection<TaskInstance>)taskInstance.getTaskMgmtInstance().getTaskInstances();
      for(TaskInstance instance : list) {
      if(instance.isOpen() && (instance.getCreate().equals(taskInstance.getEnd()) ||
      instance.getCreate().after(taskInstance.getEnd())))

      { next = false; break; }

      }
      } else {
      next = false;
      }

      if(next) {
      throw new RuntimeException("Task Creation has been skipped! -"+ taskInstance.getId());
      }

      ------------------

      As I'm using the transaction manager, I'm not explicitly closing the jbpmcontext... is the problem due to this?

      also please refer the below link for config info and the other issue...
      https://jira.jboss.org/jira/browse/JBPM-2128

      Attachments

        Activity

          People

            aguizar_jira Alejandro Guizar (Inactive)
            jasphior Jasphior S (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: