• 沒有找到結果。

Chapter 3. System Architecture

3.4 An Example

The contexts mentioned above are emphasized on the description of individual component, and lack of global illustration of the actual works among these

components during the workflow execution. Here we use a simple ask-for-leave workflow as the scenario example to describe the handing of a workflow instance being enacted.

Figure 8. A Simple Model of Ask-for-leave Workflow

The ask-for-leave workflow has three process nodes as shown in Figure 8, and the green-circled node represents the start state and the red-circled ones represent the final states. The remaining three nodes according to the sequence number are the filling form, manager verification and personnel inspection. Assume there is an employee called Aaron who wants to ask for leave. Following operations represent the sequence to create a workflow instance in our system. Firstly, Aaron must login our system to use the client tool, and his corresponding person agent (we call it as PeA_Aaron in the following context) is instantiated in the agent platform after password authentication. Secondly, he enacts the ask-for-leave workflow from the flow list provided by the client tools. Once PeA_Aaron receives the enactment instruction, it asks the workflow manager to create the corresponding workflow instance. Subsequently, the process agent (we call it as PrA_leave in the following context) will be instantiated to take charge of the enactment of the ask-for-leave workflow. So far, an ask-for-leave workflow instance has been created successfully in our system.

When PrA_leave is successfully instantiated, it begins to analyze the workflow definition according to the predefined rules and detects that the workflow is in the start node now. Then it prepares to handle the first task, i.e., the filling form stage.

First of all, it asks the workflow manager to create an artifact agent to carry the required workflow data. When the artifact agent (we call it as AA_leave in the following context) is instantiated successfully, it then retrieves the data objects from the database. In this example, these data objects compose an e-form. According to the workflow definition, the operator of the filling form task is the workflow starter, i.e., Aaron, and Aaron’s person-id is sent to AA_leave by PrA_leave. Next, AA_leave asks the workflow manager to report corresponding agent-id. If Aaron is still online, then PeA_Aaron will be notified about the new item added to the work list and ask the client tool to show the change.

Assume Aaron is online and picks up the ask-for-leave to execute.

Simultaneously, PeA_Aaron notifies AA_leave to migrate to this site and interacts to decide how the data objects should be shown. In this stage, Aaron needs only the first part of the e-form, i.e., the verification, and inspection parts need not to be shown to Aaron now. So, the client tool receives the e-form and shows it on the screen for Aaron to fill. After Aaron completes the filling, AA_leave migrates back to report the new state to PrA_leave. Next, PrA_leave analyzes the state and determines the next route. According to the workflow definition, the next stage is the manager verification and its target operator is the manager of the form writer. So, AA_leave receives the corresponding role-id from PrA_leave and then asks the workflow manager to report an agent-id of the person agent of Aaron’s Manager. Assume that there are two candidates called Bob and Cindy, but Cindy is offline currently. Then AA_leave will receive the agent-id of Bob’s person agent.

Again, there will be a new item called ask-for-leave added on Bob’s work list.

When Bob executes this task, AA_leave receives the notice of Bob’s person agent and migrates to this site to interact for adequate artifact representation. Now the first and second parts of the e-form need to be shown (i.e. the inspection part not shown here) and the first part is now read-only. When Bob completes the task, no matter what the decision is, AA_leave migrates back to report the result to PrA_leave. If the decision is "rejection", according to the workflow definition, PrA_leave detects the flow is going to complete. It sends the rejection result message to the workflow manager to notify the flow is going to complete. Subsequently, the workflow manager notifies PeA_Aaron the rejection result and asks the agent manager to destroy AA_leave and PrA_leave. Assume Bob’s decision is "acceptance". According to the workflow definition, PrA_leave confirms that the route can be proceeded and the next stage is the personnel inspection. The target operator is restricted to the members of personnel department only. And AA_leave receives the corresponding role-id and asks the workflow manager to report an appropriate agent-id. Except the artifact representation, the following sequences are similar to the previous stage mentioned above. Now the e-form shown to the operator includes all three parts and the first two parts cannot be modified.

Assume the task of personnel inspection is completed, and the decision is

"acceptance". PrA_leave receives the result and detects the flow is going to complete.

Then, it sends the acceptance result to the workflow manager and notifies the latter that flow is going to complete. Subsequently, the workflow manager notifies PeA_Aaron about the acceptance result and then asks the agent manager to destroy AA_leave and PrA_leave. Finally, Aaron gets the result of the ask-for-leave workflow and the whole execution of an ask-for-leave workflow instance terminates here.

相關文件