Skip to main content

Architecting on demand solutions, Part 9: Manage workflow tasks within your company portal

Integrating business processes into WebSphere Portal

Christina Lau (clau@ca.ibm.com), Senior Technical Staff Member, IBM Canada
Christina Lau is a Senior Technical Staff Member at IBM. Christina is an architect on the On Demand Development team focusing on next-generation technologies for the On Demand Operating Environment and SOA engagements.
Colin Yu, Advisory Software Engineer, IBM Canada
Colin Yu is an advisory software engineer at IBM. Colin is on the SOA development team focusing on SOA asset development.

Summary:  IBM® WebSphere® Portal supports the collaboration capability of the On Demand Operating Environment, enabling employees to be more productive. In this article, the ninth in the series, you explore new function introduced in WebSphere Portal 5.1 that integrates your Business Process Execution Language (BPEL)-based business processes into the portal and implements the UI with JavaServer Faces (JSF) technology. By integrating WebSphere Process Choreography with WebSphere Portal, users with different roles can interact with business processes.

Date:  17 May 2005
Level:  Intermediate
Activity:  986 views

Introduction

A typical long-running business process requires human involvement, such as approving a request or completing a form. The business process can be surfaced to customers, employees, suppliers, or other participants in the company through a portal. By integrating WebSphere Process Choreography with WebSphere Portal, your business can run its workflow tasks within the company portal. This capability allows users with different roles to use the portal to interact with business processes. The new My Tasks portlet enables users to view and work with their work items, and they can launch portlets for completing tasks without leaving the portal.

In this article, the ninth in the series, we refer to this new feature that integrates the business processes into WebSphere Portal as the process portal.


Use the process portal

Upon installing WebSphere Portal 5.1, you'll see a new My Tasks portlet. If WebSphere Portal 5.1 is configured to connect to a business process container, the My Tasks list view will display all the tasks that are assigned to you. You can connect WebSphere Portal 5.1 to the business process container in several ways. In this article, we describe the steps you need to set up the connection between a business process container running on WebSphere Business Integration Server Foundation (Server Foundation) 5.1.1 and WebSphere Portal 5.1.

Initially, when there are no tasks available for you, the My Tasks list view will display the empty message "There are no tasks available," as shown in Figure 1.


Figure 1. My Tasks portlet with an empty task list
My Tasks portlet with an empty task list

Enable the personal loan application to use process portal

Part 3: Use BPEL to create business processes describes a personal loan business process that is designed so that a loan officer is involved in certain scenarios to manually approve or reject the loan. To enable the loan officer to use the process portal to claim a loan request, you must use the BPEL editor to create a unique Client UI identifier for the loanOfficer staff approval activity, as shown in Figure 2.

A uniquely named LoanApprover is specified in the Portal Client Definitions with the default Page Definition type. This unique name will be used later when we create the task page definition in WebSphere Portal.


Figure 2. Enabling the loanOfficer approval step for WebSphere Portal
Enabling the loanOfficer approval step for WebSphere Portal

To enable the loan officer to approve or reject the loan request from the process portal, an Approve Loan portlet will be developed using Rational Application Developer (RAD) Version 6.0. The classes generated for all messages defined in the Web Services Description Language (WSDL) file for this process must be exported into a .jar file so it can be imported into the Approve Loan portlet. The PersonalLoan.jar included in the download code in this article contains all the exported classes.


Create the Approve Loan JavaServer Faces portlet

Rational Application Developer provides a set of new wizards that help you create JavaServer™ Faces (JSF) portlet applications. This section highlights the steps required to create a JSF portlet to approve or reject the loan request. Click the Code icon now to download the portlet code.

Use New Portlet Project (JSR 168) to create a new Faces portlet project. On the Miscellaneous page, make sure you check the Create portlet subclass box, as shown in Figure 3. This creates a subclass of the Faces portlet. You will need to update the generated ApproveLoanPortlet class to add extra implementations.


Figure 3. Creating a Faces Portlet subclass
Create a Faces Portlet subclass

Use the Page Designer to create the controls on the ApproveLoanPortletView.jsp. Drag and drop a JavaBean from the palette to the JSP. Enter the class loanOfficerRequestMessage that wraps the input WSDL message, as shown in Figure 4.


Figure 4. Selecting the Java class that represents the input message
Select the Java class that represents the input message

Select Displaying data (read-only) for the controls and attributes you want to display, as shown in Figure 5.


Figure 5. Select attributes from input message
Select attributes from input message

Similarly, enter the class LoanOfficerResponseMessage that wraps the output WSDL message. This time, select Inputting data for the controls and select the attributes of the message you want the loan officer to input. For example, the result attribute that returns the approve or reject status. Add a submit button and a doApproveAction action attribute for the button you will implement in the JSF page code class.

After updating the JSP, you need to update the ApproveLoanPortlet.java and the ApproveLoanPortletView.java class.

The ApproveLoanPortlet class extends the FacesGenericPorlet class. You need to:

  1. Update the init() method to retrieve the Task Manager.
  2. Update the processAction() method to handle the event sent from the My Tasks portlet. You can retrieve the human task ID and page ID of the My Tasks page from the event context. The page ID will be used in the JSF page code to return to the My Tasks page after the user completes a human task. With the task ID, you can retrieve the input message of the human task. Save the task ID, page ID, and the input message in the portlet session. Make sure you invoke super.processAction() at the end of this method to allow the JSF framework to process the request.

The ApproveLoanPortletView class extends the JSF PageCodeBase class. You need to:

  1. Modify the getLoanOfficerRequestMessage() method to retrieve the human task input message from the portlet session.
  2. Create a doApproveAction() method, which matches the name used in the action attribute of the submit button of ApproveLoanPortlet.jsp. In this method, you can complete the human task with the loanOfficerResponseMessage, which has been populated by the JSF framework with the values of the JSF UI components. Next, you need to invoke the gotoMyTasksPage() method to close the ApproveLoanPortlet UI and return to the My Tasks portlet.
  3. Create a gotoMyTasksPage() method, which closes the ApproveLoanPortlet UI and return to the My Tasks portlet with its page ID. Make sure you invoke getFacesContext().responseComplete() to prevent the JSF framework from accessing the ActionResponse object. Otherwise, the My Tasks page will not display properly.

Install the Approve Loan portlet

In addition to installing the ApproveLoanPortlet.war on WebSphere Portal server, you need to create a page that will be dynamically loaded by the My Tasks portlet based on the UniqueName, specified in Figure 2, for the loanOfficer task. Follow these steps:

  1. Create a page named Approve Loan Task Page under Task Page Definitions.
  2. Edit the page layout and add ApproveLoanPortlet into the layout.
  3. Select Portal Settings > Custom Unique Names from the navigation bar. Select Pages as the Resource type. Edit the unique name of Approve Loan Task Page, and use LoanApprover as the value, as shown in Figure 6.

Figure 6. Creating a Custom Unique Name that matches the Client UI identifier for the task
Create a Custom Unique Name that matches the Client UI identifier for the task

Configure Server Foundation and portal servers

The default installation of WebSphere Portal 5.1 creates a Server Foundation 5.1.1 server instance and configures a business container on the same node. The My Tasks portlet communicates with the local business process container to retrieve the tasks.

We'll show you how to configure the My Tasks portlet to communicate with the business process container on a remote Server Foundation 5.1.1 server. The topology for this common scenario is shown in Figure 7.


Figure 7. Simple topology and claiming tasks for BPEL deployed on Server Foundation 5.1.
Simple Topology –  Claiming tasks for BPEL deployed on server foundation 5.1.

Configuration for Server Foundation 5.1.1 (wbi.odfinance.com)

  1. Verify that the Human Task Manager fix is installed. If not, install the interim fix for the human task manager to the application server.
  2. After installation, you will find the human task manager application (task.ear) in the /installableapps directory of the application server. Deploy the task.ear file from the administrative console.
  3. Verify that the HumanTaskManager application is started. If not, start it from the administrative console.

Configuration for WebSphere Portal Server 5.1 (portal.odfinance.com)

  1. Stop the server if it is started.
  2. Set the processintegration.name property in %PortalServerInstallDir%\shared\app\config\services\ConfigService.properties to the JNDI name of the HumanTaskManager EJB on the remote Server Foundation server. For example:
    processintegration.htmJndiName = corbaname:iiop:wbi.odfinance.com:2809#com/ibm/task/api/TaskManagerHome
  3. Restart the server.

With this configuration, you can use WebSphere Portal to claim the tasks that are created by your business processes. Here are some useful tips:

  • Verify that WebSphere Portal server and Server Foundation server have the same locale settings (for example, en_us and en_ca are considered different locale settings). If they are using different locales, the My Task portlet may not display the task names correctly.
  • If the connection between WebSphere Portal server and Server Foundation server drops, for example, because Server Foundation restarts, you may need to restart WebSphere Portal Server server to retrieve the task list.

Create a loan request

The My Tasks portlet only allows you to claim or cancel the tasks assigned to you. It does not let you create a new task. To create a loan request, you can develop a new portlet and use the Process Choreographer API to initiate a new process instance. Alternatively, for testing purposes, you can simply use the built-in Process Web Client to create some new loan requests, as shown in Figure 8.


Figure 8. Initiating a loan request using the Process Web Client
Initiating a loan request using the Process Web Client

Claim the task

The My Tasks List view displays all tasks assigned to you, sorted from newest to oldest. Figure 9 shows the My Tasks List View with some tasks. To claim a task, select the check box and click Claim. The task you claim is underlined and marked as shown on the first item in Figure 8. If you do not want to take ownership of a claimed task, click Cancel Claim to unclaim the task.


Figure 9. My Tasks List View with some tasks
My Tasks List View with some tasks

To process a claimed task such as the first item in Figure 9, click on the link for that claimed task. This displays the Approve Loan Task Page that we developed earlier, in Figure 6. The loan officer can review the loan request and decide to approve or reject the loan request, as shown in Figure 10.


Figure 10. Approve Loan Portlet launched for the selected task
Initiating a loan request using the Process Web Client

Conclusion

After doing the steps in this article, you've learned how you can use the new process portal feature in WebSphere Portal 5.1. Using the personal loan business process developed earlier in this series, we showed you how to:

  • Enable the business process for process portal.
  • Develop your task-processing portlet using JSF.
  • Configure WebSphere Portal to talk to WebSphere Process Choreography located on a separate WebSphere Business Integration Server Foundation.
  • Claim a task in the My Tasks portlet and complete it.

With this integration, WebSphere Portal becomes the standard interface for working on human tasks of a business process. IBM WebSphere Portal V5.1can provide alerts for users when tasks are pending. Other portal collaboration capabilities can be used in the context of BPEL tasks, all of which empowers users to work more effectively.



Download

DescriptionNameSizeDownload method
sample codei-odoebp9code.zip200 KB HTTP

Information about download methods


Resources

About the authors

Christina Lau

Christina Lau is a Senior Technical Staff Member at IBM. Christina is an architect on the On Demand Development team focusing on next-generation technologies for the On Demand Operating Environment and SOA engagements.

Colin Yu

Colin Yu is an advisory software engineer at IBM. Colin is on the SOA development team focusing on SOA asset development.

Comments (Undergoing maintenance)



Trademarks  |  My developerWorks terms and conditions

Help: Update or add to My dW interests

What's this?

This little timesaver lets you update your My developerWorks profile with just one click! The general subject of this content (AIX and UNIX, Information Management, Lotus, Rational, Tivoli, WebSphere, Java, Linux, Open source, SOA and Web services, Web development, or XML) will be added to the interests section of your profile, if it's not there already. You only need to be logged in to My developerWorks.

And what's the point of adding your interests to your profile? That's how you find other users with the same interests as yours, and see what they're reading and contributing to the community. Your interests also help us recommend relevant developerWorks content to you.

View your My developerWorks profile

Return from help

Help: Remove from My dW interests

What's this?

Removing this interest does not alter your profile, but rather removes this piece of content from a list of all content for which you've indicated interest. In a future enhancement to My developerWorks, you'll be able to see a record of that content.

View your My developerWorks profile

Return from help

static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=Sample IT projects, Architecture
ArticleID=83180
ArticleTitle=Architecting on demand solutions, Part 9: Manage workflow tasks within your company portal
publish-date=05172005
author1-email=clau@ca.ibm.com
author1-email-cc=
author2-email=coliny@ca.ibm.com
author2-email-cc=

My developerWorks community

Tags

Help
Use the search field to find all types of content in My developerWorks with that tag.

Use the slider bar to see more or fewer tags.

Popular tags shows the top tags for this particular content zone (for example, Java technology, Linux, WebSphere).

My tags shows your tags for this particular content zone (for example, Java technology, Linux, WebSphere).

Use the search field to find all types of content in My developerWorks with that tag. Popular tags shows the top tags for this particular content zone (for example, Java technology, Linux, WebSphere). My tags shows your tags for this particular content zone (for example, Java technology, Linux, WebSphere).