4 Replies Latest reply on May 20, 2010 4:23 AM by rebody

    Prematurely completing a workflow in 4.3

    matrixpooh

      My main workflow process opens a few independent processes in one of its custom actions. Then number and type of those independent processes depends on the rules outcome. Every dependent process is a collection of human tasks in any order: parallel or sequential. Is there a way I can complete those dependent processes upon the completion of the main process? Could do this in jbpm 3.2, can't in 4.3.

        • 1. Re: Prematurely completing a workflow in 4.3
          rebody

          Hi Al,

            Maybe you can try EventListener like this.

           

            <process>

              <on event="end">

                  <event-listener class="sample.Listen"/>

              </on>

            </process>

           

            You could set a EventListener to handle processEndEvent and do what you want.

          1 of 1 people found this helpful
          • 2. Re: Prematurely completing a workflow in 4.3
            matrixpooh

            Hi HuiSheng,

             

            Thanks a  bunch for following up.

             

            I was asking a pretty basic question: how to  close processes from an activity handler of another process.  ExecutionService::endProcessInstance() all that I needed.

            But I  ran into another issue doing this call: the processes i need to close  are collections of human tasks. All or any of the tasks may be pending  at the moment of ending their processes. The call to  endProcessInstance() fails with integrity constraint: can't delete  "swimlane" records due to "task" child records. Looking into it now. If  you have any ideas, would be grately appreciated

            • 3. Re: Prematurely completing a workflow in 4.3
              matrixpooh

              More update: I modifed jbpm.task.hbm.xml to inlcude

               

              {code:xml}

              <set name="tasks" cascade="delete-orphan">

                   <key column="SWIMLANE_" />

                   <one-to-many />

              </set>{code}

              and added corresponding Set<Task> tasks with a getter to the  SwimlaneImpl.

               

              That fixed the issue and seems to have no effect on opening and updating  processes.

              • 4. Re: Prematurely completing a workflow in 4.3
                rebody

                Hi Al,


                I am sorry that I cannot understand what you want to do.  If you could provide a testcase to us, it will be appreciated.  Thank you very much.