This site contains the documentation that is relevant to older WSO2 product versions and offerings.
For the latest WSO2 documentation, visit https://wso2.com/documentation/.

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

This sample explains on how to include human task renderings in a human task and the use of Human Task Explorer. Refer the Human Task Rendering section for more information on task renderings. In this sample, the ClaimApprovalTask sample has been modified by including HT renderings. For this, you must use the Human task explorer web app (https://localhost:9443/humantask-explorer) to view the tasks. Trying to view tasks from management console will cause an exception since this sample does not have relevant JSP pages. 

The following rendering configuration snippet has been added to the ApproveClaim task (ClaimsApprovalTask.ht) inside the <htd:task name="ApproveClaim"> element.

 

<htd:renderings>
  	<!-- Display Input Information to the User -->
  	<htd:rendering type="wso2:input">
   		<wso2:inputs>
           	<wso2:element id="fname">
              	<wso2:label>First Name</wso2:label>
           		<wso2:value>$firstname$</wso2:value>
        	</wso2:element>
            	<wso2:element id="lname">
              	<wso2:label>Last Name</wso2:label>
            	<wso2:value>$lastname$</wso2:value>
        	</wso2:element>
           	<wso2:element id="amount">
                <wso2:label>Loan Amount</wso2:label>
         		<wso2:value>$euroAmount$</wso2:value>
      		</wso2:element>
            <wso2:element id="custId">
              	<wso2:label>Customer Identifier</wso2:label>
            	<wso2:value>/test10:ClaimApprovalData/test10:cust/test10:id</wso2:value>
			</wso2:element>
    	</wso2:inputs>
	</htd:rendering>
	<!-- Display elements to the user workspace which implements output message -->
	<htd:rendering type="wso2:output">
      	<wso2:outputs>
         	<wso2:element id="approved">
         		<wso2:label>Loan Approval Status</wso2:label>
               	<wso2:xpath>/test10:ClaimApprovalResponse/test10:approved</wso2:xpath>
              	<wso2:value type="boolean">Approved, Disapproved</wso2:value>
            	<wso2:default>Disapproved</wso2:default>
			</wso2:element>
   		</wso2:outputs>
	</htd:rendering>
</htd:renderings>

 

Prerequisites

  • Try the ClaimApprovalTask sample to get a better understanding on human tasks and how they work.
  • WSO2 BPS 3.5.0 or a later version

Setting up the sample

  1. Set up the sample as mentioned in the Claims Approval Task Sample topic.
  2. Create the roles (regionalClerksRole and regionalManagerRole) as mentioned in the ClaimApprovalTask sample topic.
  3. Create users for the respective roles and assign those users to the roles as mentioned in the ClaimApprovalTask sample topic.

Deploy 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.

  1. The ClaimsApprovalProcess.zip BPEL package has to be deployed as mentioned in the ClaimApprovalTask sample page. This BPEL package can be found in the<BPS_HOME>/repository/samples/bpel directory.
  2. If you have already installed the ClaimsApprovalTask.zip human task sample, un-deploy it. 
  3. Deploy the ClaimsApprovalTaskWithHTRenderings.zip sample. This HumanTask package can be found in the <BPS_HOME>/repository/samples/humantask directory.

Running the sample

This sample has to be run as already mentioned in the ClaimApprovalTask sample until the step 6. See Running the Sample for details. After the step 6, follow the steps below.

  1. Login to the HumanTask Explorer (https://localhost:9443/humantask-explorer) as the "regionalClerkUser".
  2. Go to the "My Tasks" tab of the HumanTask Explorer web app (https://localhost:9443/humantask-explorer/mytasks)  where there will be a task listed as following.
  3. Click on the task row to open the task info page.
  4. Click on the Start button. Then the rendered task information can be seen as following.
  5. Check the checkbox for Approval Status and click on "Complete" button to complete the task or "Save" button to save the current info and to complete it at a later time. You can see the saved tasks from the "My Tasks" page under the "In Progress" filter.
  6. Once you complete the task, it will be listed under "Completed" filter. The history, attachments and comments for the task can be seen in the tabs at the bottom of the page.

    This is how you can use HT Renderings to display your task information.

 

  • No labels