bea.com | products | dev2dev | support | askBEA |
|
e-docs > WebLogic Platform > WebLogic Integration > BPM Topics > Learning to Use BPM > Executing and Monitoring the Example Workflows |
Learning to Use BPM |
Executing and Monitoring the Example Workflows
Note: The Worklist client application is being deprecated as of this release of WebLogic Integration. For information about the features that are replacing it, see the BEA WebLogic Integration Release Notes.
In this section we execute the example workflows from the WebLogic Integration Worklist. We then monitor the running instances of the workflows from the Studio.
Before you can do the procedures given in this section, it is assumed that you have done the following:
Note: Although the Worklist and the monitoring functions of the Studio are described in this section, the section is not intended to serve as a tutorial for them. For more information about these topics, see Using the WebLogic Integration Worklist and Monitoring Workflows in Using the WebLogic Integration Studio.
Executing the Workflows in the Worklist Application
Because the Order Processing Trigger workflow contains a manual start, we can execute it from the Worklist application. This workflow then launches all the tasks of the Order Processing and Order Fulfillment workflow. In this section, we do the following:
Logging On to the Worklist Application
Because we have defined the user admin as a member of all the roles used in the sample workflows, we will log on as admin.
To start the WebLogic Integration Worklist:
t3://host:7001
Figure 7-2 WebLogic Integration Worklist Dialog Box
Figure 7-3 Worklist Application Main Window
Starting the Sample Workflows
We start the sample workflows by starting the Order Processing Trigger workflow, which was designed to be started manually. It sets off the main workflow of the sample, Order Processing.
Any Worklist user can start the workflow.
To start the Order Processing Trigger workflow:
Figure 7-4 Start Workflow Dialog Box
Figure 7-5 Worklist Application: Task List
Notice that the status of the Start Order Processing task does not change to Done. This is because this task is assigned interminably, as specified by the looping mechanism and the lack of a Done node in the workflow design (see Understanding Task Node Properties: Viewing the Start Order Processing Task Node).
Each time you execute this task, another instance of it appears in admin's tasklist. Thus, every time you want to start the Order Processing workflow, you do not need to start the Order Processing Trigger workflow from the Workflow menu; you simply double-click the Start Order Processing task in the worklist.
Executing the Order Processing Workflow Tasks
The first task in the Order Processing workflow is the credit check, which was assigned to the user admin. In this section, we will execute all the tasks specified in the workflow path that follows a Yes response to the Check Customer Credit task.
To execute the Order Processing workflow tasks:
Figure 7-6 Credit Check Message Box
Figure 7-7 Task Marked Done
At this point, let us view the status of the Order Processing workflow to which the Check Customer Credit task belongs. Select the Check Customer Credit task, and choose Workflow
Figure 7-8 Workflow Status Dialog Box
Note that the Check Inventory task, an automated task, is already marked done. When the inventory check passes (which it always does in our example), the next task is the Start Order Fulfillment task, which automatically starts the Order Fulfillment sub-workflow. Executing the Order Fulfillment Workflow Tasks The workflow assigns the Generate Invoice task to the Accounting role and the Ship Order task to the Shipping role at the same time. If you switch between the Accounting and Shipping role tabs, you see that the tasks appear simultaneously. Although the order in which we execute either of these tasks is unimportant, we will start with the shipping task. Note also that if you logged on to the Worklist as joe, who is defined as a member of the Accounting role, the Generate Invoice task is also included in joe's worklist on the Accounting role tab. If you logged on to the Worklist as mary, who is defined as a member of the Shipping role, the Ship Order task is also included in mary's worklist on the Shipping role tab. If you want to try executing the tasks from those worklists, open additional instances of the Worklist by logging on with those user names. Enter password as the password for both users. To execute the Order Fulfillment workflow tasks:
As you may recall from Defining a Custom Exception Handler: Viewing the Bad Data to OrderBean Exception Handler, executing this task causes the Calculate Total Price business operation to be performed. This operation, in turn, causes the invalid KK state data provided in the Order Processing Trigger workflow XML event to be passed to the calculate() method on the POBean EJB. The calculate() method then causes the server to throw the BadStateException exception.
Because the Order Fulfillment workflow defines an exception handler to catch the exception, you do not see any evidence of the exception in the Worklist client. Instead, you simply receive the message box specified by the Send XML to Client action defined in the Bad Data to OrderBean exception handler. (For more information, see Viewing the Send XML to Client Action.)
Figure 7-9 Error Warning Dialog Box
Let us see what happens if we again enter invalid state data.
The Generate Invoice task is now executed and marked as done. The Calculate Total Price business operation calculates the total price of the order, and returns the value to the Order Processing workflow. The Confirm Order Fulfillment task is automatically executed and the entire process is complete.
If you included the Send E-mail action when defining the Order Processing workflow (see Sending an E-mail Message: Defining the Confirm Order Fulfillment Task), you will receive the e-mail with the text you composed.
Otherwise, you can view the results of the complete workflow operation by following the procedures in the next section.
Monitoring the Running Workflows in the Studio
In this section we will rerun the workflows twice, following the two paths specified in the Order Processing workflow: the first time we will reply No to the Check Customer Credit task and execute the Contact Customer task, which terminates the Order Processing workflow; the second time we will reply Yes and execute the remaining tasks of both the Order Processing and Order Fulfillment workflows.
At the same time that we run the workflows in the Worklist, we monitor the running workflow instances in the Studio. You should have both the Worklist and an instance of the Studio open, in the organization CDExpress.
To run and monitor the Order Processing workflow instances:
Figure 7-11 Workflow Status Order Processing Window
Figure 7-12 Workflow Variables Window
Figure 7-13 Task Comment
Now we will rerun the workflow for a third time to monitor the instance of the completed workflow after a Yes response to the credit check task.
To rerun and monitor the Order Processing and Order Fulfillment workflows:
Figure 7-14 Workflow Instances Order Fulfillment Dialog Box
Figure 7-15 Workflow Status Order Fulfillment Window
You have now completed the business process management tutorial.