6 Replies Latest reply on Feb 20, 2009 8:44 AM by kukeltje

    Blocking call from Java to jBPM workflow

      Hi,

      I am able to invoke jBPM workflow from java using processInstance.signal();
      This is not a blocking call.
      Is there any function call that will block the client thread until workflow is ended or stopped.
      Or is there a call back handler that I can use to implement this functionality.

      -Harshit

        • 1. Re: Blocking call from Java to jBPM workflow
          salaboy21

          Actually processInstance.signal();
          is blocking.
          Why did you say that is not blocking?

          • 2. Re: Blocking call from Java to jBPM workflow
            kukeltje

            Mauricio,

            It is blocking until the process enters a first waitstate.... So it is not blocking until the process ends. Not that you would want that.... if so, you have STP and should not use waitstates

            A 'callback handler' is easily done as an action on the process-end event

            • 3. Re: Blocking call from Java to jBPM workflow
              salaboy21

              of course that is blocking until the process reach a wait state.. that is what i'm saying..
              I don't understand why hkapoor@ciber.com say that is not blocking.
              So is blocking for nature.. i you use a wait state is because that you want to stop this blocking behavior and let someone else interact with the process.
              I think if hkapoor@ciber.com understand the concept he should review his question...
              he also mention "workflow is ended or stopped", so i understand that he think that always the process interaction is not blocking



              • 4. Re: Blocking call from Java to jBPM workflow
                kukeltje

                yes, ended or stopped... I read that as the same....

                • 5. Re: Blocking call from Java to jBPM workflow

                  I understand that processInstance.signal(); is a blocking call till first wait state, I apologize for incomplete post. I am looking for a call that blocks until the workflow is over. Use case is as follows:
                  BusinessProcess that I am implementing includes webservice orchestration (done through BPEL) and human intervention activities (done through jPDL). The need is to crisply segregate Webservice orchestration from workflow management, so that workflow engine can be changed without affecting orchestration and vice versa. For this the workflow has been wrapped as a SOAP service and is being used in orchestration. The requirement is such that business process does not finish until workflow is completed, that is why I am looking for a call that blocks until workflow ends, is there one ?.
                  Or can I implement this by creating a java class that sends out signal to start workflow and at the same time register a call back handler for end event. This call back handler when invoked sends response back to the invoker.

                  -Harshit

                  • 6. Re: Blocking call from Java to jBPM workflow
                    kukeltje

                    Blocking things when there are many manual and external things going on is plain wrong from an architecture point of view.

                    As mentioned before, you can use an actionhandler on a process-end event to do whatever you want...... look at it a little first...