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 and JSR 286 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 three 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 and JSR 286 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).

For WebSphere® Portal V6.0, or later, the SDO DataObject is stored in a session attribute.

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 tasks

Developing business process portlets

Creating a business process portlet project

Enabling business process portlets that use the Basic portlet model

Adding data access to business process portlets

Creating user interfaces for business processes

 

Related reference

WebSphere Portal Documentation Library