In an on demand business environment, efficient customer, employee, and supplier interaction is critical. Your business needs to ensure that all users, regardless of role, can seamlessly participate and collaborate in business processes. Developers need to provide interfaces to support human interaction with business processes, such as filling out forms or responding to alerts.
Part 18 of this series introduces an insurance claim business process. This article uses that process to show how the business-process portlet tooling in Rational Application Developer V6.0.1.1 simplifies the development of business-process portlets for integration in WebSphere Portal V5.1.0.3.
In WebSphere Portal, each human task in a process is associated with a task page definition whose content always contains a task-processing portlet. This portlet retrieves the input message of a human task, displays it to the user, obtains user input, and passes it back as the output message to the Human Task Manager. (See Resources for more information.)
In this article, you are guided through the steps to develop task-processing portlets using the new features of Rational Application Developer. It is assumed that you are familiar with Business Process Integration (BPI) concepts.
Develop business process portlets with Rational Application Developer tooling
A WebSphere Portal business process application contains several components:
- The business process (including control and data flow) and client information required to associate a task with a task page in a portal
- Process initiation and task-processing portlets as the user interface (UI) to the process itself and the contained human tasks
Part 18 described the steps for enabling a business process for WebSphere Portal. In this article the focus is on the development of the task-processing portlets.
The real differentiations between all the types of task-processing portlets are the schema of the input or output message and the UI. The code to access the back end is always the same and operates on generic message classes. It can be separated and reused multiple times in different portlet projects. As a result, the portlet tooling of Rational Application Developer is now extended with new business-process portlet capabilities. The tool now provides two additional portlet project templates: one for task processing and one for business process instantiation portlets that already include any code required to communicate with the back end.
With Rational Application Developer, the development process is simplified because the portlet developer can focus on building UI instead of writing code. Because the new functions are based on the JavaServer Faces (JSF) framework, the JSF UI generation capabilities can also be used for business-process portlets. In this article, you learn the major steps for developing task-processing portlets as follows:
- Import the task interface and schema definitions of the input/output messages into Rational Application Developer for later use.
- Create the portlet project and the input/output message schemas are made available to the JSF framework.
- Generate the UI for the input/output messages. The binding to the data objects and back end is automatically performed.
- Export the portlet.
We'll also develop a portlet for the contact task introduced in Part 18 to go through each step. We'll also highlight the differences in the new Rational Application Developer tool.
Import the task interface and input/output message schemas
The task interface and schemas of the input/output messages are required to:
- Generate the task-processing portlet.
- Run-time access by the resulting portlet (which must be packaged as part of the portlet project).
The process developer exports the Web Services Description Language (WSDL) and XML Schema Definition (XSD) components that describe the tasks of the process as a JAR named InsuranceClaim.jar and sends it to the portlet developer. The JAR can be created by selecting the InsuranceClaim project, right-clicking it and selecting Export > JAR file.
Because the files must be available as part of a Rational Application Developer project and cannot be directly accessed from within the JAR, the portlet developer extracts the JAR and imports its content into a simple project. This can be created as follows.
- Select File > New > Project.
- Expand the node named Simple.
- Select Project.
- Enter the name InsuranceClaimInterfaces in the Project name field.
- Select Finish.
Be sure to use the Web perspective of RAD, and ensure that the Project Explorer view is selected. If not, it can be changed with the menu item Windows.
Now the portlet developer can import the WSDLs and XSDs, as follows.
- Right click on the created project displayed in the Project Explorer.
- Select Import > File system.
- Navigate to where you have stored your InsuranceClaim process project.
- Mark the folders that contain the (WSDL) interfaces and XSDs, as shown in Figure 1.
- Select Finish.
Figure 1. Importing WSDL and XSD files

Your project should now look similar to Figure 2.
Figure 2. New project tree

Create the portlet project and import required artifacts
Now that the preparation of the workbench is finished, you can create the portlet project using the following steps.
- Select File > New > Project.
- Select Portlet Project (JSR 168).
- Enter the name
InsuranceClaimPortletsin the Name field. - Ensure WebSphere Portal Version 5.1 is selected.
- Select Next.
- For the Portlet type, choose Faces Portlet (JSR 168) and select Next.
- On the next panel leave everything as it is, and select Next.
- On the PortletSettings panel, change Portlet Name and DisplayName to ContactCustomerPortlet and select Next.
- On the next panel, ensure that only View mode is marked. Change Initial Page to /ContactCustomerPortletView.jsp and select Next.
- On the next panel, select Enable business process integration.
- Choose Add Task Processing.
- Select Finish.
Your Rational Application Developer should now look similar to Figure 3.
Figure 3. The portlet project

Next we need to import the JAR files (for any input or output message classes that the task portlet will use) into the portlet project's /WEB-INF/lib folder.
- Expand your project until you can see the /WEB-INF/lib folder.
- Right-click the lib folder.
- Select Import > File system.
- Navigate to where you stored the JAR containing the messages of the InsuranceClaim process project.
- Select JAR and Finish.
The resulting project should now look like Figure 4.
Figure 4. Resulting project

We must make the input and output messages available to the JSF framework. To do that:
- Ensure the appropriate portlet page (JSP file) is opened. If not,
double-click the JSP file (in our case the file ContactCustomerPortletView.jsp) as shown in Figure 5.
Figure 5. ContactCustomerPortletView
- Open the Business Process Messages wizard. As shown in Figure 6, from within the Page Data view, select New > Business Process Message.
Figure 6. Business Process Message
- Next, you need to decide whether the message should be used to initiate a business process or to handle a task of the business process. In this example, we want to develop a task-processing portlet. To do that:
- Select Handle a task in the business process, as shown in Figure 7.
- Browse the WSDL file describing the interface of the human task "Contact," (contactTaskInterface in our example).
Figure 7. Providing WSDL for the Business Process Message
- Select Next.
- The next panel displays the defined port types, the
operations inside each port type, and input/output messages for
each operation. You want to display parts of the input message
(compare to the steps in Part 18) and the form, to enter the values of the output message. To do that, select the input and
output message, as shown in Figure 8.
Figure 8. Input and output messages
- Select Finish.
The wizard generates the necessary code and Javadoc annotations based on the information in the interface WSDL and schema files. After the code generation ends, the message becomes visible in the Page Data view, as shown in Figure 9, and is ready to be bound to a JSF UI component.
Figure 9. Page Data View

If the input message (for process initiation) or the output message
(for task processing) includes complex types, they must be initialized in
the getter method generated in the page code. Select Edit Page Code from
the portlet JSP file's pop-up menu, and type the initialization code in
the corresponding getter method for the message. For example, if attributes of the CustomerInfo and PolicyInfo are to be exposed, the highlighted code shown in Listing 1 must be added.
Listing 1. Initialization code
public Object getDoManualContactResponseMsg()
{
if (doManualContactResponseMsg == null)
{
doManualContactResponseMsg = getSessionScope().get(TaskProcessingHelper.
TASK_OUTPUT_MESSAGE);
DataObject message = (DataObject) doManualContactResponseMsg;
message.createDataObject("CustomerInfo");
message.createDataObject("PolicyInfo");
}
return doManualContactResponseMsg;
}
|
To generate the UI that represents the input/output messages, you must drag the input or output message properties from the Page Data view and drop them onto the JSP. This creates a corresponding JSF component and automatically binds the properties to the input/output message.
With the target portlet mode's JSP file still open, do the following steps:
- Select the input message properties, as shown in Figure 10.
Figure 10. Input message properties
- Right-click one of the properties.
- Select Insert new controls for selected objects.
- Select Display an existing record (read-only), as shown in Figure 11.
Figure 11. Selecting fields to be displayed
- Select Finish. Figure 12 shows the generated JSF component for this example.
Figure 12. JSF component
- Now select the output message parameters, as shown in Figure 13.
Figure 13. Output message parameters
- Select Updating an existing record, as shown in Figure 14.
Figure 14. Inserting a record
- Select Finish. You can see the generated JSF component in Figure 15.
Figure 15. Generated JSP component
You can remove the Delete button since it is not needed for this case. Finally, the remaining step is to add the code behind the Submit button using the tool.
- Unfold the actions folder in the Page Data view.
- Drag and drop the processTask item, shown in Figure 16, on the Submit button.
Figure 16. Binding code for Submit button
- Save the JSP.
This step results in an automatic linkage of the processTask code with the button. We can view the generated code by selecting the button and selecting Quick Edit.
Important steps for portlets for WebSphere Process Server processes
This section has a few required steps for portlets that should be generated for WebSphere Process Server processes. The interface editor of WebSphere Integration Developer uses a WSDL style called "Document Literal Wrapped" that generates a complex type around the input/output data objects defined on the editor. Because Rational Application Developer 6.0.1.1 is the first release that tolerates WebSphere Process Server processes, that style is not yet completely supported and you need to perform some manual steps.
First, you need to update the created DataObject references in the JSPs. (Note the way the JSPs display depends on the defined task interfaces.)
Take a look at the following example (Figure 17), where we define the operation doManualContact with the input claimRequest.
Figure 17. Defining the operation

In the source code of the generated JSP, you will see an entry like that shown in Listing 2. The doManualContactParameters part is the wrapper around the claimRequest input message defined in the editor and must be removed. So change the line to the one in Listing 3.
Listing 2. Remove all references
pc_ContactCustomerPortletView.doManualContactRequestMsg.doManualContactParameters. claimRequest.claimType |
Change the references in the JSP to that shown in Listing 3.
Listing 3. Changing all references
pc_ContactCustomerPortletView.doManualContactRequestMsg.claimRequest.claimType |
To create a portlet for the WebSphere Process Server platform, you must define the correct property resolver.
- Open the faces-config.xml file in the \WEB-INF folder.
- Replace the line in Listing 4 with the line shown in Listing 5.
Listing 4. Open the faces-config file
<property-resolver>com.ibm.faces.databind.SelectItemsPropResolver </property-resolver> |
Listing 5. Changing the faces-config file
<property-resolver>com.ibm.faces.sdo.bp.SDOPropertyResolver </property-resolver> |
Save your changes.
Export the created task portlets
Next, you need to export the project as a WAR file to generate our deployable using these steps:
- Right-click on the project.
- Select Export > WAR file.
- Enter appropriate values in the available input fields.
So now you can deploy the portlets using the WebSphere Portal administration and assemble the Task Pages. (See Part 18 for more information.)
In this section you learn how to generate the Process initiation portlet. The procedure is quite similar to developing task processing portlets. You will notice the difference in the following steps when you reach steps 9 and 10.
- Select File > New > Project.
- Select Portlet Project (JSR 168).
- Enter a name in the Name field.
- Ensure WebSphere Portal Version 5.1 is selected, then click Next.
- Choose Faces Portlet (JSR 168) for the portlet type, and select Next.
- On the next two panels, leave everything as it is and select Next.
- Ensure that only View mode is marked, and select Next.
- Check the Enable business process integration box.
- Choose Add Process Initiation.
- Enter the template name of the process to be initiated into the Template name field.
- Select Finish.
The UI (relevant input fields and buttons) is created similarly to the UI of task processing portlets.
Note: If you build process initiation portlets for WebSphere Process Server, you need to perform the following extra steps.
- Open the Deployment Descriptor (web.xml) of the portlet project.
- Select the References tab.
- Change the Name field from
ejb/BusinessProcessHometoejb/BusinessFlowManagerHome. - Change the Home field from
com.ibm.bpe.api.BusinessProcessHometocom.ibm.bpe.api.BusinessFlowManagerHome. - Change the Remote field from
com.ibm.bpe.api.BusinessProcesstocom.ibm.bpe.api.BusinessFlowManager. - If you define the JNDI name, be sure to also replace
BusinessProcessHomewithBusinessFlowManagerHome. - You also need to perform the steps described in Important steps for portlets for WebSphere Process Server processes.
When building business processes that involve human tasks, developing task-processing and process-initiation portlets is necessary. This article provided sufficient information about how to do this using the new capabilities of IBM Rational Application Developer V6.0.1.1. These capabilities offer a simplified development process by automating the creation of the relevant artifacts, such as a JSF component and the binding of input/output message properties. The result is an easier and faster methodology for the developer.
| Description | Name | Size | Download method |
|---|---|---|---|
| Sample code | i-odoebp20code.zip | 2.46MB | HTTP |
Information about download methods
Learn
- Series overview: Link to previous articles and read about this series, which demonstrates to business analysts, solution designers, and architects how to design and implement on demand solutions using the thirteen capabilities of the IBM On Demand Operating Environment.
- WebSphere Process Server and WebSphere Integration Developer Information: Learn all about them.
-
"Developing business process portal applications using WebSphere tooling" (developerWorks, May 2005): Read about the programming aspects of integrating a business process into a portal.
- Business Process Execution Language for Web Services Version 1.1: Learn the current specifications and standards.
-
"Use IBM WebSphere Integration Developer to assemble components: Set up human tasks, business process integration, and security" (developerWorks, Feb 2006): Read Part 18 of this series, which covers human tasks, and the steps in a workflow that require user action. You also find out how to include human tasks within your Business Process Execution Language (BPEL) process.
Get products and technologies
-
Download a free trial version of
WebSphere
Application Server Version 6.0.
-
Build your next development project with
IBM trial software, available for download directly from developerWorks.
Discuss
- developerWorks blogs: Get involved in the developerWorks community.

Dr. Jamison currently works with the IBM On Demand Software Development team and is heavily involved with many projects pertaining to business performance management and service-oriented architecture (SOA). His expertise also includes J2EE application servers, performance analysis, Tivoli Monitoring for Transaction Performance, Web services, and more. He is a contributor of the book, Performance Tuning for Linux Servers. Contact Dr. Jamison at wjamison@us.ibm.com.

Andreas Nauerz Andreas Nauerz works as Software Engineer in the IBM Laboratories at Boeblingen, Germany. His current work areas include Business Process Integration and Dynamic UI Management. He studied Computer Science at the University of Cooperative Education of Mannheim, the University of Staffordshire, the University of Saarbruecken, and the University of Hagen, respectively.

Juergen Schaeck is a Software Engineer at IBM Boeblingen Lab. Juergen holds a Master's degree from the University of Karlsruhe and currently works in WebSphere Portal Development. You can contact Juergen at jschaeck@de.ibm.com.
Comments (Undergoing maintenance)

