2 Replies Latest reply on Jul 12, 2011 6:13 PM by johnesky

    Getting the current state in a process and printing out as String

    johnesky

      Please I need help. How can I retrieve the current state in a process into a String variable. Thanks.

        • 1. Re: Getting the current state in a process and printing out as String
          calca

          With this you can get the state:

          WorkflowProcessInstance pi = (WorkflowProcessInstance)ksession.getProcessInstance(pid);

          int state = pi.getState

           

          And states are:

          int STATE_PENDING   = 0;

          int STATE_ACTIVE    = 1;

          int STATE_COMPLETED = 2;

          int STATE_ABORTED   = 3;

          int STATE_SUSPENDED = 4;

           

          I don't know if there is any method that makes that, but you can code it easily with this information.

           

          Hope it helps,

           

          Demian

          • 2. Re: Getting the current state in a process and printing out as String
            johnesky

            Thanks alot. That was really helpful. I don't know if you can help me again here.  For instance I have 4 web pages in a web application, and I want to execute a process through those 4 web pages. Lets say, if the first web page is running on the browser, the process should start. And if the second web-page is running on the browser, the process should continue to the second state. And if the third web page is running on the browser, the process should continue to the third state. And if the fourth web page is running, the process should end.

             

            I'd really appreciate any help you can give. Thanks.