0 Replies Latest reply on Jun 16, 2006 2:46 PM by Michael H.

    Canceling a TaskInstance operates like ending this instance

    Michael H. Newbie

      I'd like to cancel the operation on a taskInstance and expect the following (intuitive?) behavior:

      task variable values should not be submitted to the process variables
      the taskInstance should not be marked as finished
      no transistion should be taken (because at least one taskInstance was not finished and we have still unfinished tasks)

      Unfortunately, jBPM behaves completely different :-(
      Maybe, because I have a completely different intuition?

      Here a little code snippet:

      Collection tasks = taskMgmtInstance.getUnfinishedTasks(processInstance.getRootToken());
      TaskInstance task;
      for(Iterator iter=tasks.iterator(); iter.hasNext();)
       task = (TaskInstance) iter.next();
       task.setVariable("newFeature", true);

      My task node is defined as follows:
      <task-node name="Do evaluate initial request">
       <task name="Change request?" swimlane="project manager" blocking="true">
       <variable name="newFeature" access="read,write,required"></variable>
       <transition name="" to="New feature?"></transition>

      In my example, the taskInstance's variable is submitted to the process, and the taskInstance is marked as completed.

      Any opinions would be appreciated.