[Bernstein09] Section 5.2. Business Process Definition

来源:百度文库 编辑:神马文学网 时间:2024/04/28 01:25:46
5.2. Business Process Definition
Abusiness process definition specifies the steps of the businessprocess, the work performed by each step, the order in which the stepsexecute, and how steps communicate with each other. That is, it definesthe control flow and data flow between steps. It also specifies thecomponents of the state of the business process and how they relate toeach other.
Abusiness process definition can be distributed among the steps of theprocess. For example, consider a travel reimbursement request. The stepthat captures the request from the user can include logic to send amessage to the appropriate manager for approval. The step that capturesthe manager’s approval can either forward a request-for-payment to theaccounting department (if approved) or return the original request tothe employee (if rejected).
Alternatively,the business process definition can be expressed as a single program.In this case it is usually a relatively simple script-like program, nota complex algorithm with complex data structures. For the travelreimbursement example, this program would first receive the requestinput from the user and then send a message to the manager forapproval. Based on the manager’s reply, it would either send arequest-for-payment message to the accounting department or send therejected request to the employee.
Independentof how the business process is defined, it is best to encapsulate eachstep of the business process separately. This allows the businessprocess definition to focus on the flow of control and data betweensteps without being cluttered by the application logic of each step. Italso is consistent with the goal of reusing services in aservice-oriented architecture. Each encapsulated step can be defined asa service that can be invoked in multiple business processes.
Systemsthat support the execution of business processes usually offer aspecial-purpose programming language for specifying business processes.For the most part, these are ordinary languages with local variablesand the usual control flow constructs, such as if-then-else, do-while,RPCs, one-way messages, parallel execution of a set of statements, andexception handlers. In addition, there are a few constructs that aresomewhat specialized for business processes. One construct is to waitfor the arrival of one or all of a set of messages and events (such astimeouts). Another is to send a message to a particular instance ofanother business process, thereby enabling business processes on twosystems to coordinate their activities by passing messages back andforth.
Businessprocesses typically are driven by events that reflect actions in theoutside world: a house purchaser receives a mortgage approval, aninvestor receives a trade confirmation, a programmer receives a bugreport, or an author receives a draft publishing contract. It istherefore natural to specify a business process as a finite statemachine. Such a machine has a finite set of states. For each state, itspecifies the set of events that can occur. Each event causes themachine to perform an action and move into a different state. Anexample state machine appears inFigure 5.1.A finite state machine is a convenient way to specify a businessprocess when at each point in time there are several possible eventsthat cause the process to act, and those events can arrive in anyorder. This typically arises when events correspond to actionsperformed by people, which can happen in arbitrary orders.
Figure 5.1. Finite State Machine. A mortgage approval process specified as a finite state machine.

Onelimitation of the finite state machine model is the difficulty ofspecifying transaction boundaries and compensating transactions. Aprocedural specification is often more natural for capturing theseaspects of a business process definition.
Astep of a business process may need to interact with a person. Forexample, a person may be needed to review a special order or approve atravel request. In a large organization, it is important that thebusiness processidentify these people by their roles and not by their names. Thisallows multiple people to serve the same role, such as using multipleexpediters to handle nonstandard orders. It also allows people tochange roles dynamically, such as enabling a manager to approve travelrequests for one of her subordinates when the subordinate is onvacation. The mapping of roles to people is explicitly stored and usedby the runtime environment to assign a step of a given business processto the right person.