Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

...

The ClaimsApprovalTask sample has a BPEL process that accepts claims approval requests. If the claim approval amount is greater than 1000, the process requires human interaction for the claim approval. In this sample, a regional manager will be assigned an approval task (human task) to interact with the system and approve or reject the claim. If the amount is less than 1000, no human interaction is required and the claim approval process will continue. 

Image RemovedImage Added

Creating the Required Roles and Users

...

  1. In the BPS management console, go to Configure  Configure -> Users and Roles -> Roles, and then click click Add New Role.Image RemovedImage Added
  2. Enter Enter regionalManagerRole for the role name and click click Next.
     Image RemovedImage Added
  3. Select Select All Permissions to  to give all permissions to this role to the role created and click click Finish (the users will be added later). Image RemovedImage Added
  4. Repeat these steps to create another role called called regionalClerksRole .
    Image RemovedImage Added

To create the users:

  1. Go to Configure  Configure -> Users and Roles -> Users, and then click click Add New User.Image Removed Image Added
    First, we must will create a user who has will have the regionalManagerRole role.
  2. Enter Enter regionalManagerUser for  for the user name and enter any password, and then click click Next.
    Image RemovedImage Added
  3. Select Select regionalManagerRole and click click Finish. 
    Image RemovedImage Added
  4. Repeat these steps to create another user with username username regionalClerkUser and  and assign the the regionalClerksRole as  as the role.

You now have the two users and are ready to deploy the sample.
Image RemovedImage Added

Deploying the Sample

You will now deploy the ClaimsApprovalTask sample by adding the tasks and process associated with the sample.

To add the tasks:

  1. Go to to Main -> Human Tasks -> Add.
  2. Browse to and select ClaimsApprovalTask.zip, which is located in in <BPS_HOME>/repository/samples/humantask, and click click Upload.
  3. Click Click OK in  in the confirmation message and then refresh the page.

The The ApproveClaim and  and ClaimApprovalReminder task  task definitions appear in the deployed task configurations list.

Image RemovedImage Added

You can click a task definition to view it. The ApproveClaim task definition looks like this:

Image RemovedImage Added

To add the process:

  1. Go to Main  Main -> Processes -> Add.
  2. Browse to and select ClaimsApprovalProcess.zip, which is located in in <BPS_HOME>/repository/samples/bpel, and click click Upload.
  3. Click Click OK in  in the confirmation message, wait a few moments, and then refresh the page.

The The ClaimsApprovalProcess process  process is now deployed and appears in the Deployed Processes list.

Running the Sample

You can will now run the sample using by taking the following steps:

  1. Go to to Main -> Processes -> List.
  2. In the Process ID column, click the process ID for ClaimsApprovalProcess: {http://www.wso2.org/humantask/claimsapprovalprocess.bpel}ClaimsApprovalProcess-1 
    The Process Information screen appears, displaying information about this process.
    Image RemovedImage Added
  3. In the WSDL Details section of the process information screen, select select claimsApprovalPartnerLink from  from the Partner-Links list, and then click click Try It.
    A new browser window appears where you can replace the placeholder values with the values you want to send.
  4. Replace the sample with the following values:

    Code Block
    languagehtml/xml
    <body>
       <p:ClaimApprovalProcessInput xmlns:p="http://www.wso2.org/humantask/claimsapprovalprocessservice.wsdl">
          <xsd:custID xmlns:xsd="http://www.wso2.org/humantask/claimsapprovalprocessservice.wsdl">customerId</xsd:custID>
          <xsd:custFName xmlns:xsd="http://www.wso2.org/humantask/claimsapprovalprocessservice.wsdl">customerFName</xsd:custFName>
          <xsd:custLName xmlns:xsd="http://www.wso2.org/humantask/claimsapprovalprocessservice.wsdl">CustomerName</xsd:custLName>
          <xsd:amount xmlns:xsd="http://www.wso2.org/humantask/claimsapprovalprocessservice.wsdl">5000</xsd:amount>
          <xsd:region xmlns:xsd="http://www.wso2.org/humantask/claimsapprovalprocessservice.wsdl">reagon</xsd:region>
          <xsd:priority xmlns:xsd="http://www.wso2.org/humantask/claimsapprovalprocessservice.wsdl">1</xsd:priority>
       </p:ClaimApprovalProcessInput>
    </body>

    You can now view this process instance in the management console.

  5. Go to to Main -> Business Processes -> Instances.
    Notice that the ClaimsApprovalProcess-1 instance has been created and is active.
  6. Click the instance ID to view the activity flow. The flow of the process depends on the value we specified for the the amount property property. If the amount is less than 1000, the BPEL process handles the approval, so the process terminates without initiating the human task. If the amount is over 5000, as we specified above, the ClaimsApprovalTask is initiated, and the process waits until it receives approval from the human task activity. To view this task, you must log in as the user who is assigned this task.
  7. Click Click Sign-out, and then log in as as regionalClerkUser.
  8. Go to to Main -> Human Tasks -> List (be sure to click the link lower down in the left navigation pane, not the one in the Manage group).
    Image Removed Image Added
    The task appears in the My Tasks list.
  9. In the Task ID column, click the link for the task.
  10. Click Click Start to  to start the task.
    Image RemovedImage Added
  11. To approve the request, click click Approve in  in the Response section, and then click click Complete.
    Image RemovedImage Added
  12. Go to to Main -> Business Processes -> Instances. You can see that the instance, which was previously waiting for approval, has now completed successfully.