This documentation is for WSO2 Enterprise Integrator version 6.5.0 . View documentation for the latest release in the 6.x.x family and the latest release in the 7.x.x family.

All docs This doc
||
Skip to end of metadata
Go to start of metadata

Introduction

The ClaimsApprovalTask sample has a BPEL process that accepts claims approval requests. The Client is the user who requests for claim approval and sends a claim forward. 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 a Claims Approval Task (human task) to interact with the system and approve or reject the claim. If the amount is less than or equal to 1000, no human interaction is required and the Claim Approval Process will continue. 

Creating the Required Roles and Users

Before you run the sample, you must create two users with different roles.

Creating the Roles

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

Creating the Users

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

You now have the two users and ready to deploy the sample.

Deploying the Sample

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

If you already deployed a human task sample, delete the relevant ZIP file from the <EI_HOME>/samples/business-process/humantasks directory to undeploy it before deploying another sample.

Deploying the Human Task

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

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

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

Deploying the BPEL Process

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

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

Running the Sample

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

  1. Go to Processes>List>BPEL in the Main menu.
  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.

    If the Status is "Retired", click on Activate to activate the process.

  3. In the WSDL Details section of the process information screen, select claimsApprovalPartnerLink from the Partner-Links list, and then 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:

    <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 will not view a response in the Response section of the Try It tool. You can now view this process instance in the Management Console.

 Exploring the artifacts in the Management Console

Follow the steps below to explore the artifacts in the Management Console

  1. Go to Instances>BPEL in the Main menu.
    Notice that the ClaimsApprovalProcess-1 instance has been created and is active.
  2. Click the Instance ID to view the activity flow. The flow of the process depends on the value we specified for the amount property. If the amount is less than or equal to 1000, the BPEL process handles the approval, so the process terminates without initiating the human task. If the amount is over 1000, 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.
  3. Click Sign-out, and then log in as regionalClerkUser.
  4. Go 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).


    The task appears in the My Tasks list.
  5. In the Task Definition column, click the link for the task. You can see a read only view of the task information.

Testing the output in the Human Task Explorer

  1. Log in to the Human Task Explorer as the regionalClerkUser.
  2. Click MY TASKS and click on the task to view its details.

  3. Click Start to start the task.


  4. To approve the request, select Approved in the Loan Approval Status section, and then click Complete. 

  5. Click Yes on the confirmation message. 


    You view the task being approved and completed.

  6. Click MY TASKS → Completed. You view the tasks you completed.
  • No labels