This documentation is for WSO2 Business Process Server version 3.5.1. View documentation for the latest release.
||
Skip to end of metadata
Go to start of metadata

When a human task is available, a task client should display the task information and actions for the task assignees. For this, the task applications should know how to render the task information. WS-Humantask specification provides a container to provide rendering information to Task Client application. The following image from WS-Human Task specification depicts the structure of rendering elements.

Task rendering details are out of the scope of WS-Humantask and it's up to different implementations. So WSO2 input and output renderings have been introduced from WSO2 Business Process Server 3.5.0 onwards. Human Task explorer (https://localhost:9443/humantask-explorer/) web application has been shipped with BPS to work in human tasks with HT renderings.

Following is the syntax for WSO2 input-output renderings for Human Tasks.

<htd:renderings>
    <htd:rendering type="wso2:input" xmlns:wso2=”http://wso2.org/ht/schema/renderings/”>
        <wso2:input>
            <wso2:element id=”[id for the display element]”>
                <wso2:label>[Label to display for the input element]</wso2:label>
                <wso2:value>[xpath to get the value from the input message / presentationParameter]</wso2:value>
            </wso2:element>+
        </wso2:input>
    </htd:rendering>
    <htd:rendering type="wso2:output" xmlns:wso2=”http://wso2.org/ht/schema/renderings/”>
    <wso2:output>
        <wso2:element id="[unique id for each element]">
            <wso2:label>[Label to display for the form field]</wso2:label>
            <wso2:xpath>[xpath of the element in the output message to be filled with this form field]</wso2:xpath>
            <wso2:value type="[string | boolean | Int | double | list]">[comma separated values for list type]</wso2:value>
            <wso2:default>[default value for above mentioned value element]</wso2:default>
        </wso2:element>+
    <wso2:output>
    </htd:rendering>
</htd:renderings>


Each element of the syntax is explained below.

ElementDescription
<renderings>Within “renderings” element, rendering types are listed.
<rendering>
Following attributes are required in a rendering element.
  • The namespace is specified as: xmlns:wso2=”http://wso2.org/ht/schema/renderings/
  • The type of the rendering is specified by the “type” attribute as follows:
    • If the rendering elements listed under <rendering> are input renderings : type="wso2:input"
    • If the rendering elements listed under <rendering> are output renderings : type="wso2:output"
<wso2:input>Used to render input information to the task instance in the user interface. Each information is represented by <wso2:element> which list input information that needs to display as label / value pairs.
Format of rendering input element (<wso2:element>) as follows:

<wso2:element id=”[Unique id for the display element]”>
   <wso2:label>[Label to display for the input element]</wso2:label>
   <wso2:value>[xpath to get the value from the input message / presentationParameter]</wso2:value>
</wso2:element>

Attributes
id - Unique ID for each element

Child elements
<wso2:label> - Label (or text) to display with the value
<wso2:value> - The value to display with the label. This value can be extracted from the input message (by providing xpath) or by presentation parameters.

Example 01 : retrieving value by xpath
<wso2:element id="custId">
  <wso2:label>Customer Identifier</wso2:label>
  <wso2:value>/test10:ClaimApprovalData/test10:cust/test10:id</wso2:value>
</wso2:element>

Example 02 : Set value by presentation parameter defined in the presentationParameters in humantask definition
<wso2:element id="fname">
  <wso2:label>First Name</wso2:label>
  <wso2:value>$firstname$</wso2:value>
</wso2:element>
<wso2:output>Used to render user workspace (to generate html form that need to filled by the task assignee) and to populate response message to the callback service when task instance get completed. Each form element is represented by <wso2:element>.
Format of the output rendering element () as follows:
<wso2:element id="[unique id for each element]">
   <wso2:label>[Label to display for the form field]</wso2:label>
   <wso2:xpath>[xpath of the element in the output message to be filled with this form field]</wso2:xpath>
  <wso2:value type="[string | boolean | Int | double | list]">[comma separated values for list type and boolean type]</wso2:value>
  <wso2:default>[default value for above mentioned value element]</wso2:default>*
</wso2:element>

Attributes
id - Unique ID for each form element

Child elements
  • <wso2:label> - Label to display for the form field
  • <wso2:xpath> - XPath of the element in the output response message to be filled with this form field input content
  • <wso2:value type=””> - The “type” attribute is used to define the type of the form field.
    • string : provide text area
    • int / double : provide number input
    • boolean : provide radio buttons. Texts to display with two radio buttons should provide as comma separated values within value element, with respective to “true” and “false”.
    • list : provides a drop-down selection. Texts to display in the dropdown list should provide as comma separated values.
  • <wso2:default> - Can provide default value to display in the form

Example:

<htd:rendering type="wso2:output">
  <wso2:outputs>
      <wso2:element id="approve">
         <wso2:label>Loan Status</wso2:label>
             <wso2:xpath>/test10:ClaimApprovalResponse/test10:approved</wso2:xpath>
          <wso2:value type="boolean">Approved, Not approved</wso2:value>
          <wso2:default>Disapproved</wso2:default>
     </wso2:element>
     <wso2:element id="loanTypeSelectList">
          <wso2:label>Loan Type</wso2:label>
          <wso2:xpath>/test10:ClaimApprovalResponse/test10:loanType</wso2:xpath>
          <wso2:value type="list">car loan, house loan, development loan, education loan</wso2:value>
          <wso2:default>house loan</wso2:default>
     </wso2:element>
     <wso2:element id="loadDescription">
          <wso2:label>Loan Description</wso2:label>
          <wso2:xpath>/test10:ClaimApprovalResponse/test10:description</wso2:xpath>
          <wso2:value type="string"></wso2:value>
          <wso2:default>car loan</wso2:default>
     </wso2:element>
     <wso2:element id="loanInterestAlteration">
          <wso2:label>Loan Interest Alteration</wso2:label>
          <wso2:xpath>/test10:ClaimApprovalResponse/test10:interest</wso2:xpath>
          <wso2:value type="int"></wso2:value>
          <wso2:default>1000</wso2:default>
     </wso2:element>
  </wso2:outputs>
</htd:rendering>


When you use a Human task deployed with human task renderings, the Human task explorer application should be used to work with created tasks. The human tasks page in Management console will not work. Refer Claims Approval task with HT Renderings Sample for a complete sample.

 

  • No labels