IBM BPM, V8.0.1, All platforms > Customize and rebranding interfaces > Customize Process Portal > Building Process Portal spaces > Building customized Process Portal spaces > Use custom form renderers for the Task Information widget

Enabling the Task Information widget to use custom form renderers

The Task Information widget supports a custom extension service. You can use this service to implement alternative forms and rendering technologies for the form content.

You have created a custom form renderer based on the com.ibm.task.form.Renderer interface.

To make a custom form renderer available to the Task Information widget, you must include the rendering implementation and its configuration information in a web application. You can have only one web application that is configured for custom form renderers; however multiple form renderers can be registered in this web application.

You can replace the default renderer for the entire system, or only for certain clusters.


Procedure

  1. Specify the configuration information for the custom extension service in the config.json file. This file provides a mapping between the client types and the form renderer that is to be used for a specific client type.

    The following code sample shows the schema description of the config.json file.

    { "type" : "object",  
      "description" : "Form renderer package information",   "properties" : {
        "renderers" : { "optional": "true", "type": "array", "items": { "properties": {
          "clientType" : { "type": "string", "optional": "true",                        "description": "Unique identifier for this form 
                            renderer registration. If omitted, this renderer 
                            is used for the task template if no client type 
                            matches."},       "location" : { "type": "string", 
                         "description": "The path to the root for the renderer 
                          module, relative to the registered REST root URI."},       "className" : { "type": "string", 
                          "description": "The Dojo class name of the renderer."},} } } } }
    Where:

    clientType

    The clientType is the schema equivalent of the user interface client type that was specified for the task in Integration Designer. The client type can be any string except for the following reserved types:

    Dojo

    Used for HTML-Dojo forms

    Lotus Forms

    Used for forms based on IBM Forms

    LeanTask

    Used for free-form tasks where users create the form together with the task

    IBM_WLE_Coach

    Used for coach-based forms

    className

    The Dojo class name of the custom form renderer; the name must be unique.

    For example, the following code sample shows the entry in the config.json file to configure the com.acme.JspRenderer for the Acme JSP Renderer client type:

    {
      "renderers":[    {
          "clientType": "Acme JSP Renderer", 
          "location": "/script", 
          "className": "com.acme.JspRenderer"
        }   ]}
  2. Deploy the web application that contains the custom form renderer and the config.json file.

    For example, the web module contains both the /script/com/acme/JspRenderer.js and the config.json files.

  3. Create an endpoint description XML file to define the endpoint for the custom extension service. The name of the endpoint must be {com.ibm.bpm}CustomExtension. The following example shows a sample endpoint.xml file.
    <?xml version="1.0" encoding="UTF-8"?>
    
    <tns:BusinessSpaceRegistry 
         xmlns:tns="http://com.ibm.bspace/BusinessSpaceRegistry"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://com.ibm.bspace/BusinessSpaceRegistry/BusinessSpaceRegistry.xsd"
      <tns:Endpoint> 
        <tns:id>{com.ibm.bpm}CustomExtension</tns:id>
        <tns:type>{com.ibm.bpm}CustomExtension</tns:type> 
        <tns:version>7.5.0.0</tns:version> 
        <tns:url>/MyCustomExtensionService</tns:url>
        <tns:description>Location of the custom extension service</tns:description>
       </tns:Endpoint>
    </tns:BusinessSpaceRegistry

    The URL is the URL for the web application that you deployed in step 2.

    A sample endpoint.xml file is provided with IBM BPM:

     INSTALL_ROOT/BusinessSpace/registryData/BPM/endpoints/CustomExtensionServiceEndpoint.xml
  4. Register the endpoints for the web application using the updateBusinessSpaceWidgets wsadmin command.
    $AdminTask updateBusinessSpaceWidgets {
       -nodeName  node_name
       -serverName  server_name
       -endpoints  path_to_endpoint.xml 
       } 


Results

The Task Information widget can use the custom form renderer for the form content.

Use custom form renderers for the Task Information widget


Related reference:
updateBusinessSpaceWidgets command