Preparing the Process for Human Interaction
The process that is explained here is based on the Loan Approval process that is built when you complete the Process Developer Tutorial. During this part, you will:
- •Replace the Web service that determines if a loan is approved or rejected with a people activity so that a person can make this decision.
- •Update the logic to return an immediate acknowledgment to the loan requester if this path of the process is taken.
- •Send a message to a customer service representative after the people activity completes.
Step 1. Remove the Invoke Loan Approver Activity
Since the decision to approve or reject a loan is now handled by a person, you need to update the loan approval process by removing the call to the loan approver Web service. This call will be replaced by a people activity.
- 1. From the Project Explorer, expand the bpel folder and open the loanProcessHuman.bpel process.
- 2. Select the Invoke Loan Approver activity on the canvas, right-click, and select Delete.
- 3. In the Outline view, expand the Participant Partner Links section, right-click on the LoanApproval node, and delete it. This removes the LoanApproval participant from the Participants view.
Step 2. Update the Reply Sent to the Loan Requester
Before invoking the people activity, it makes sense to reply back to the loan requestor, informing the requestor that the loan will be reviewed. Do this by updating the reply activity that follows the Invoke Loan Approver activity just deleted.
Next, format a message indicating that the loan is now under review. Do this by defining the data properties associated with the Reply activity. This implicitly builds an Assign statement that initializes the message variable.
- 1. Select the Return Approval Response reply activity and rename it to Under Review.
- 2. Select the Under Review activity.
- 3. In the Properties view for this activity, select the Data tab.
- 4. Change the Assignment from Single Variable to XPaths.
- 5. Press the Add button to create a new XPath copy expression.
- 6. Edit the XPath expression as follows:
- - In the first column headed E/L (for Expression/Literal), select Literal.
- - In the From column, select the ... button (the dialog button) to open the Literal Contents dialog.
- - Select Generate, and then Finish to accept the default values to create the loan:loanApprovalResponse element.
- - Change the values in the generated XML as follows. The result is shown in the following illustration.
- ▪ Change the value in the <loan:responseToLoanRequest> element to underReview.
- ▪ Remove the value of string in <loan:responseDescription>.
- ▪ Because it is not needed, you can delete the optional <loan:rejectionReason>...</loan:rejectionReason> element.
- 7. Because you are allocating a literal value for the entire content of the approval variable, there's no need to specify a value for the To Path part of the assignment.
- 8. Delete the approver variable from the Variables section in the Outline view. It is no longer needed.
Your process should look like this: