LDD Today

Extending QuickPlace workflow

by
Firas
Yasin

Level: Intermediate
Works with: QuickPlace
Updated: 03-Sep-2002

Of all the features QuickPlace offers, one of the more attractive is its capacity to let you customize and extend its functionality to suit your particular needs. This month's issue of LDD Today includes two article describing customization techniques that include using PlaceBots. (PlaceBots are special programs for performing a specific task. They are similar to agents in Notes/Domino.) In addition to this article, "Adding calendar roll-up to QuickPlace" explains how to combine calendars for multiple inner rooms and display them as a single calendar in the main room.

In this article, we describe another way you can customize QuickPlace, in this case enhancing its workflow. Our example extends QuickPlace's out-of-the-box workflow capabilities by providing a PlaceBot for automatically moving selected documents into an appropriate folder. We start by explaining what our example does and then give step-by-step instructions for incorporating the PlaceBot, which you can download from the Sandbox, into your own Place. This article assumes you're an experienced QuickPlace developer and are familiar with QuickPlace terminology.

Understanding the approval process workflow
Imagine your Human Resources department generates a document whenever a new employee is hired. These documents then need to be placed into the proper department folders for further processing. For example, if Sandy Smith is hired by your company, the applicable HR people must approve the New Employee document. This approval is done using standard QuickPlace workflow functionality. Once the final approver gives the go-ahead, Sandy Smith's document must be transferred into the personnel folder of the hiring department (for example Marketing).

To automate this process, we created a PlaceBot. This PlaceBot runs nightly to move these new hire documents from a folder called Approved to the appropriate department folders. The following graphic illustrates this process.

Approval process workflow

To implement this workflow process, you must:
The following sections explain how to perform these three tasks.

Creating the folders
The first step in setting up the approval workflow is to create the folders to contain New Employee documents. To create folders, you must be logged in as a manager of the Place:
You can also restrict the access of who can add pages to the folder to managers only. (We recommend you do this for the department folders and the Approved folders.) By doing this, you ensure that a document can't be added to any of these folders without being approved. You can restrict access by clicking the Only managers radio button when you choose the name of the folder.

After completing these steps, your welcome page should be similar to the following:

Example Welcome page

Creating the New Employee form
Now that your folders are in place, it's time to design the form to use when creating New Employee documents. As when creating the folders, you must be logged in as a manager of the Place:
You have created a new form that will place documents in the Waiting Approval folder. Documents will reside in that folder until the final approver checks off on it. Once that is done, the form will automatically move the document into the Approved folder.

The New Employee form you have just created can move approved documents into the correct folder. It can't, however, analyze the content of a particular field and route documents into the appropriate folders accordingly. This means the form cannot move New Employee documents into the folder for the correct hiring department. For that, you need a PlaceBot—which we'll describe next.

Creating the PlaceBot
Our PlaceBot is a Java program that runs within your Place. It looks in the Approved folder for any documents awaiting routing to the appropriate department. When the PlaceBot finds a document, it reads the value in its Department field. The PlaceBot then moves the document into the correct department folder.

To create the PlaceBot, you must first download its Java file (or .class file, if you do not want to see the actual code) from the Sandbox, and place it in a local file folder on your PC. You can compile the Java file and upload the .class file to QuickPlace, or you can upload the Java file directly. In our example, we will use the .class file.

You, as creator/signer, must have access to all folders and documents processed by this PlaceBot for it to run properly. To create the PlaceBot:
After you click Done, QuickPlace displays a message stating it is uploading the .class file. When the upload is complete, the PlaceBots page reappears.

Testing the new approval process
Now it's time to see whether or not you've done everything correctly. To test the approval process, first create the New Employee document: The page will be placed in the Waiting Approval folder (which you can open to make sure everything's working properly). After all the required users approve this document, QuickPlace automatically puts it in the Approved folder. (Again, you can check on this by opening the Approved folder and ensuring approved documents have been routed there.)

Next you can run the DeptSorter PlaceBot to move the document to the appropriate department's folder. You can log into the QuickPlace as a manager and run the PlaceBot manually or wait until the scheduled time. For testing purposes, you can do this manually:
DeptSorter runs, routing any documents in the Approved folder to the appropriate department folder. To do this, DeptSorter performs the following steps:
To check whether DeptSorter has run properly, open a department folder and make sure your test documents have been placed where they belong.

For added security, you can modify DeptSorter to route the documents into department rooms instead of folders to store the final approved document. (QuickPlace rooms are Domino databases, folders are views within databases.) Note that the sample code we provide for DeptSorter includes explanatory comments, which you can follow to help you modify the PlaceBot if you choose.

Customizing QuickPlace: Endless possibilities
Our relatively simple example demonstrates one way you can extend the power of QuickPlace and adapt it to your own particular needs. Feel free to experiment with our sample code, especially if you're experienced with QuickPlace programming. To learn more about PlaceBots and other QuickPlace development features, see the QuickPlace documentation, available for download from the Documentation Library, or consult the IBM Redbook, Customizing QuickPlace.


ABOUT THE AUTHOR
Firas Yasin is a Software Engineer for IBM, providing pre-sales support for several Lotus products. He currently concentrates on QuickPlace and Sametime development and customization. He is also one of the authors of the IBM Redbook Working with the Sametime Community Server Toolkit. A University of Kentucky graduate, Firas lives in Lexington, Kentucky and enjoys tennis when he's not working.