Human Approval Completed Sample

This is a completed version of the Human Approval Sample.  In the Human Approval sample we updated the Loan Process created in the ActiveVOS Tutorial by adding human interaction by using a People activity.  The People activity is based on the WS-BPEL Extension for People and WS-Human Task specifications.  

This document contains the following information:

Getting Started

To start we are going to create a new orchestration project based on the Human Approval Completed sample template.  By using this template we will create a new orchestration project which includes a complete loan approval process, including human interaction.

Step 1. Create a new Orchestration Project

  1. Open the ActiveVOS Designer and select File > New > Orchestration Project from the main menu.
  2. Enter a value of HumanApprovalCompleted for the Project name and press Next.
  3. Select Human Approval Completed from the list of ActiveVOS Samples to use the Human Approval Completed template.
  4. Press Finish.

Start the ActiveVOS Embedded Server

Before we can deploy the Loan Process, and the supporting partner processes, to the ActiveVOS Server we must start it.  Instructions for starting the server can be found in the Starting the ActiveVOS Server Sample.  Once the server is started please continue with the next step.

Deploy the Loan Process

To deploy the Loan Process we need to create a Business Process Archive (.bpr) file by exporting the Process Deployment Descriptor (.pdd) file.  These files are packaged in the deploy folder of this sample along with another file containing a .bprd extention.  

Step 1. Export the .pdd file to generate the .bpr and deploy to the server

  1. In the Navigator view expand the deploy folder.
  2. Right-click on the following files:
  3. Expand the Orchestration folder and Select Business Process Archive File.
  4. Press Next.
  5. Set the following properties:
    1. Make sure that the loanProcessHumanCompleted.pdd file is selected.
    2. Press the Browse... button and navigate to the deploy folder of your project and specify a file named loanProcessCompleted.bpr (note: the file will be overwritten if it already exists).
    3. Select Web Service from the Deployment Type Drop-down list.
    4. Create a .bprd file by checking the checkbox option for this choice.
    5. Navigate to the deploy folder of your project and specify a file named loanProcessHumanCompleted.bprd (note: the file will be overwritten if it already exists).  The .bprd file will save all the choices that we specifiy during the deployment and will make re-deploying the process a one-step process.  We will see how to deploy using the .bprd file in the next section when we deploy our partner processes.
    6. Check the Replace existing resources checkbox.
    7. Your dialog should look similar to this:
    8. Press the Finish button.
    9. A dialog indicating the status of the deployment will be displayed:
  6. Press OK.
  7. The Loan Process is now deployed.

Deploy the Partner Processes

In the section we are going to deploy the two partner processes that the Loan Process uses to process a loan.  The BPR files for the partner services are included in the Partner Services folder of the HumanApprovalCompleted project. You will use the ActiveVOS console to deploy the two BPR files (loanCRM.bpr and riskAssessment.bpr). Instructions for doing this are located in Part 10 of the ActiveVOS Tutorial chapter in the ActiveVOS Designer Online Help.

Run the Loan Process on the server

Before we run the process we want to ensure that the URNs that we used in our Process Deployment Descriptor (.pdd) file that defined our partner services are mapped to the actual URL's where those services were deployed to.  After that we can run a simple Ant script to run our Loan Process.

Step 1. Verify the URN Mappings

  1. Open the ActiveVOS Console, normally located at http://localhost:8080/activevos/ and navigate to Admin > Configure Server > URN Mappings page and set/verify the following URN Mapping:
    1. URN: urn:x-vos:loancompany
    2. URL: http://localhost:8080/active-bpel/services/${urn.4}

Step 2. Run the deployed process using the Request Form

To run to process on the server we are going to use the Request From that we deployed to ActiveVOS Central in a previous step.  

  1. Enter the following link in a web browser:  http://localhost:8080/activevos-central/.
  2. Sign in using the following credentials:
    1. Username: loanrep1
    2. Password: loanrep1
  3. In the left side navigation pane choose the Tutorial and Samples section from the Requests tab and select then select the Human Approval Completed Form.
  4. Enter details as shown below and submit the form by pressing the Send Request button:
  5. The request is submitted to the server and the response is populated int he Process Output section:
  6. To see the status of the running process enter the following link in a web browser:  http://localhost:8080/activevos/ and select HOME > Active Processes from the ActiveVOS console:
  7. Press the loanProcessHumanCompleted process to view the details of the process.  As the screen shot below shows the process is waiting on the ReviewLoan People activity:
  8. The process will wait in this state until the People activity is completed or expires.

Claim, Update and Complete the Human Task

The loan that was requested requires human intervention to complete due to the amount of the loan.  To complete the loan process a human loan representative must claim and complete the task.

Claim and Start the task

  1.  In ActiveVOS Central select the Tasks tab.  A new task was added to the list of unclaimed, open tasks for the user loanrep1 as the screen shot below shows.  If the task is not displayed press the Refresh button. Start this task by selecting the row and pressing the Claim button and then the Open In Tab  button: 
  2. Complete the task by:
    1. Change the value of the ResponseToLoanRequest drop-down list to approved.
    2. Enter some text for the ResponseDescription.  Note: you must enter a string > 10 characters.
    3. Press the Complete button to complete the task.
  3. Go back to the Task list and verify that the task is now completed and moved to the list of Closed tasks:

Review the completed Loan Process

Once the human task has completed the loanProcessHumanCompleted process will continue on and complete.  You can check this by refreshing the loanProcessHumanCompleted process from the list of Active Processes and/or from the process details

  1. Press the Refresh button to see the current state of the process.  As the screen shot below shows the ReviewLoan People activity has completed.  All other activities in the process have also completed leaving the process in the Completed state.