For business operations that only require a small and very well defined flow of steps, the standard toolkit operation model is usually adequate. However, it can be useful to define operations as state machines so that you can reuse common steps in different combinations to fulfill multiple business processes. You therefore define an operation processor as a combination of standard operations or operation steps executed during different states of the processor. Note that if you chose this approach for server operations, you need to define a policy for launching the process from a client. This is possible because processors, like operations, use a set of formats that access a context containing data and services. To illustrate this, the toolkit provides a very simple example of a generic server operation flow along with its corresponding states diagram and external definitions required by the toolkit.
A processor that implements the Operation interface enables the states defined in the processor to represent the actual operation steps that the toolkit executes during the business operation flow. In the com.ibm.btt.automaton.ext package, the DSEOperationProcessor class, inheriting from DSEProcessor, provides behavior for an operation. These relationships are shown in the design class diagram below.
The class DSEStep, inheriting from DSEAction, also provides behavior for an operation as an action of the flow of the process. It can contain any code that might be running inside an "standard" operation or operation step. The inheritance hierarchy of DSEStep is shown in the following class diagram:
The definition for the states might include an operation step as an entry action. DSEStep signals OK and error events and you can define these events as transitions to the appropriate state to advance the process. These entry actions can be a combination of atomic steps (such as a single interaction with a service), a larger action encapsulating a set of steps (such as executing a whole operation with its own operation steps), or even a subprocessor that represents the execution of another entire business operation.