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 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.
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). 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. |
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-ref> <ejb-ref-name>ejb/BusinessProcessHome</ejb-ref-name> <ejb-ref-type>Session</ejb-ref-type> <home>com.ibm.bpe.api.BusinessProcessHome</home> <remote>com.ibm.bpe.api.BusinessProcess</remote> </ejb-ref>You must map this reference to the JNDI name of the deployed EJB on your target portal server.