Task processing helper classes

A task processing helper class is generated when you create a business process portlet with the Add task processing option available in the New Portlet Project wizard or New Portlet wizard. The class is included in a JAR file (portlet-bp.jar for the JSR 168 API or wp-portlet-bp.jar for the IBM® portlet API) that is copied into /WEB-INF/lib in the task processing portlet project.

A helper class encapsulates the common code for task processing portlets. There are two helper classes, depending on which portlet API that you choose:

The helper classes provide the following methods to be called from task processing portlets:
Table 1. Task processing helper methods
JSR 168 portlet API method IBM portlet API method Description
public void init() public void init(PortletConfig config)

This method initializes task manager and task UI manager services.

public void receivePageContext(ActionRequest request) public void setProperties(PortletRequest request, PropertyValue[] properties)

This method receives task properties (task ID, task UI handle, and return page ID), and creates and stores input and output messages in session attributes (TASK_INPUT_MESSAGE and TASK_OUTPUT_MESSAGE).

Map interfaces for the input and output messages are stored in session attributes, so that get() and put() methods can be used to get/set message parts.

receivePageContext() must be called from processAction() method of the JSR 168 API task portlet, and setProperties() must be called from setProperties() method of the IBM portlet API task portlet.

public void processTask() public void processTask()

This method completes the task using the output messages in the session attributes.

pubic void closePage(ActionRequest request, ActionResponse response) public void closePage(ActionEvent event)

This method closes the task page. It is typically called after calling processTask() in the processAction() method.

Related concepts
Process initiation helper classes
Related tasks
Creating a business process portlet project
Developing business process portlets
Related reference
WebSphere Portal Documentation Library
Feedback
(C) Copyright IBM Corporation 2000, 2005. All Rights Reserved.