6 Replies Latest reply on Jan 13, 2012 7:32 PM by pmancham

    When is the process state saved

    whabelitz

      Hi,

       

      In which situation is the state of a process stored? During a user task or a service task until it is completed or aborted? During waiting for a signal or running a timer until it is expired? Is the status of the process changed to SUSPENDED during this time?

       

      So in which situations I can shutdown the application running the workflow engine with active persistence without loosing the actual state of a workflow process? Inside chapter 7 of the user guide it is named "safe points". So I want to know what are the safe points?

       

      Regards

        • 1. Re: When is the process state saved
          salaboy21

          Hi Whabelitz,

          A safe point is basically a point where is safe to store the process status. You can think about safe points as every time that the process engine is delegating an activity to an external entity. This external entities can be Users or Systems (asynchronous systems). So, every time a safe point is hit (User task or asynchronous call to an external system) the engine can store the current status, and that status can be recovered later.

          Cheers

          • 2. Re: When is the process state saved
            whabelitz

            So asynchronous work items and user tasks are the only options for a safe point? What is with waiting for signal or timers? And when is the status SUSPENDED set for a process?

            • 3. Re: When is the process state saved
              salaboy21

              Waiting for signal and timers are the same situation.. you delegate to an external entity the execution thread, that means that the process can persist the current status until the timers due or the external events comes.

              SUSPENDED is not related with that at all.

              Cheers

              1 of 1 people found this helpful
              • 4. Re: When is the process state saved
                whabelitz

                Ok. Now I know when a process is at a safe point. But when is the process status set to SUSPENDED?

                • 5. Re: When is the process state saved
                  salaboy21

                  I don't have the code infront of me right now, but that suspended means, that the business process instance was suspended at business level. I'm don't remember if there is an API to change that status now..

                  • 6. Re: When is the process state saved
                    pmancham

                    I created a workitem to call a web-service. I added the workitem to a workflow and I would like the process state saved immediately after the work item is executed. (So, that if I had to load the workflow after a server crash, the workflow will start from a point where it does not have to make same web-service call again - if it already called that webserivce before server crash)

                     

                    What should I have in my WorkItemHandler.executeWorkItem() method in order to achieve this?