Process initiation helper classes

A process initiation helper class is generated when you create a business process portlet with the

Add process initiation 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 and JSR 286 API or, wp-portlet-bp.jar for the IBM® portlet API) that is copied into /WEB-INF/lib in the process initiation portlet project.

A helper class encapsulates the common code for process initiation portlets. There are two helper classes, depending on which portlet API that you choose, but the only differences are the portlet API types, such as PortletRequest.

The helper classes provide the following methods to be called from the process initiation portlets:

Table 1. Process initiation helper methods
Method Description
public void init()

This method initializes a business process interface.

public void setTemplate(PortletRequest request, String name)

This method creates a business process input message using the specified template name, and stores it in a session attribute (PROCESS_INPUT_MESSAGE).

For WebSphere® Portal v5.1, the map interface for the input message is stored in a session attribute, so that get() and put() methods can be used to get/set message parts.

For WebSphere Portal v6.0, the SDO DataObject is stored in a session attribute.

public void initiateProcess()

This method initiates a business process using the template name specified in setTemplate(), and the input message in the session attribute.

 

EJB reference mapping

For WebSphere V6.0, or higher, the process initiation helper requires the following EJB reference, which is automatically generated in web.xml by the New Portlet Project wizard and the New Portlet wizard:

	<ejb-ref>
	<ejb-ref-name>ejb/BusinessFlowManagerHome</ejb-ref-name>
	<ejb-ref-type>Session</ejb-ref-type>
	<home>com.ibm.bpe.api.BusinessFlowManagerHome</home>
	<remote>com.ibm.bpe.api.BusinessFlowManager</remote>
</ejb-ref>
You must map this reference to the JNDI name of the deployed EJB on your target portal server.

 

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