5 Replies Latest reply on Nov 25, 2008 11:59 AM by kukeltje

    End Node -  End All Tasks

    tpaz

      Hi,

      I'd like End-Node to end all tasks of the current process.

      Can someone recommend how to do that?

      Thanks, Tomer

        • 1. Re: End Node -  End All Tasks
          kukeltje

          look at the end-complete-process attribute on an end node. But iirc, if you just have one end node that already should happen

          • 2. Re: End Node -  End All Tasks
            mputz

            I think things got mixed up here. The 'end-complete-process' attribute on end-state only makes sense in an end-state that appears in a leg of a fork, and which should end the complete process, see https://jira.jboss.org/jira/browse/JBPM-1181.

            Ending a process does not end the taskInstances, that's the default behavior IMO. There is at least one JIRA issue for this, too https://jira.jboss.org/jira/browse/JBPM-392.

            A workaround would be to end the taskinstances in an ActionHandler on the process-end event.

            • 3. Re: End Node -  End All Tasks
              tpaz

              I tried the following handler, which seems straightforward:

              public class EndAllTasks implements ActionHandler {

              public void execute(ExecutionContext executionContext) throws Exception {
              executionContext.getTaskMgmtInstance().endAll();
              }
              }

              but I'm getting a concurrent exception.

              I'm looking for a clean and simple solution.

              Thanks, Tomer

              • 4. Re: End Node -  End All Tasks
                mputz

                Using an ActionHandler with taskMgmtInstance.endAll() in the process-end event should work.

                If you experience any issues, please create a unit test, let us know which version you are working with and show us the exception.

                • 5. Re: End Node -  End All Tasks
                  kukeltje

                  Things did not get mixed up... there is a line missing from my post... probably wrong quoting again...My first line was:

                  If you have multiple end-nodes in your processdefinition and there is more then one token still active when the current token arrives in the specific end-node, this behaviour might occur.