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 loanProcessHumanCompleted.pdd file and select Export....
  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.  As we mentioned in the previous section we are going to deploy using the settings already saved in the .bprd files for each process.

Step 1. Deploy the LoanCRM process

  1. In the Navigator view expand the Partner_Services folder.
  2. Right-click on the loanCRM.bprd file and select Execute from the menu.
  3. A dialog indicating the status of the deployment will be displayed:
  4. The LoanCRM process is now deployed.

Step 2. Deploy the riskAssessment process

  1. In the Navigator view expand the Partner_Services folder.
  2. Right-click on the riskAssessment.bprd file and select Execute from the menu.
  3. Review the status of the deployment to make sure that the process deployed successfully.

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

  1. In the ActiveVOS Designer expand the project's GenerateLoanRequests folder, right-click on the generateRequests.xml file and select Run As > Ant Build.
  2. The output of the script is displayed in the Console view:
  3. The messages from the embedded server are no longer displayed in the Console View.  To switch back to the embedded server’s console press the Display Selected Console icon from the toolbar and choose ActiveVOS 6.0 from the list of consoles as the screen shot below shows:
  4. To see the status of the running process you can select HOME > Active Processes from the ActiveVOS console:
  5. 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:
  6. 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 sign in to the ActiveVOS Inbox, claim and complete the task.

Step 1. Open the ActiveVOS Inbox

  1. Enter the following link in a web browser:  http://localhost:8080/activevos-inbox/.
  2. Sign in using the following credentials:

Step 2. Claim and Start the task

  1.  A new task was added to the list of unclaimed, open tasks for the user loanrep1 as the screen shot below shows.  Start this task by selecting the row and pressing the Start button:  
  2. Complete the task by:
    1. Change the value of the Loan Response drop-down list from Under Review to Approved.
    2. Enter some text for the Response Reason.  Note: you must enter a string > 10 characters.
    3. Press the Save button.
    4. Press the Complete button and confirm that you want to complete the task.
  3. Go back to the inbox and verify that the task is now completed and moved to the list of Closed > Completed 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. Refresh the process details.  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.