Try OpenEdge Now
skip to main content
BP Server Developer's Guide
Process instance management : Working with process instance states : Getting the process instance state
 

Getting the process instance state

BP Server provides APIs to determine the current state of the ProcessInstance. Along with the state information, you can also check for the existence of the ProcessInstance and verify its validity.
*public int getState()
Returns the state of ProcessInstance as an integer. BP Server defines a specific integer value for each state. This API is not generally meant to be used directly by a user. Instead, we recommend using the API getStateDescription(), which returns the state of ProcessTemplate as a String.
*public String getStateDescription()
Returns the state of ProcessInstance, from the possible states listed below:
*PI_CREATED
*PI_ACTIVATED
*PI_SUSPENDED
*PI_COMPLETED
There are some direct APIs available to check whether a ProcessInstance is activated or suspended.
*public boolean isActivated()
If the process instance is in the activated state, then you get the value as true. You can perform any operation on the Activated ProcessInstance, including suspension and removal.
*public boolean isSuspended()
If the process instance is in the suspended state, then you get the value as "true". You can only resume a suspended ProcessInstance, or remove it completely.
*public boolean isValidProcessInstance()
If the process instance is valid, then you get the value as "true".
*public boolean isProcessInstanceExist(Session session, String ptName)
BP Server provides a direct API in the BP Server, which enables you to check the existence of a process instance without loading the ProcessTemplate SVO.