IBM BPM, V8.0.1, All platforms > Authoring services in Integration Designer > Developing business processes > Building business state machines

Querying the status of a business state machine in the runtime environment

When an instance of a business state machine is active in a runtime environment it will always be in one of its available states, and queries can be made to determine what this state is.

To enable a user in the runtime system to determine the state that is currently active, proceed as follows:


Procedure

  1. To return the internal name of the currently active state, add an operation called getState to one of the business state machine's interface definitions and proceed as follows:

    1. Set the input of this operation as the correlation value of the associated process instance.
    2. Name the output state, and give it a data type of string
  2. Similarly, to return the display name of the currently active state, add an operation called getDisplayState.

    1. Set the input and output parameters to match those of getState.


Results

During processing, the runtime environment will automatically generate variables for both of these operations.


What to do next

The data in this procedure may not always be current for either of the following reasons:

Building business state machines