Recently, I have been looking at integrating the Work Manager Service with process engines such as ActiveBPEL, Oracle Process Manager and Intalio|n3. The Work Manager Service is responsible for managing manual (i.e human-centric) activities, which could be part of a larger long running business process. At the manual activity level the process engine would delegate all the responsibility for managing the activity to the Work Manager Service. Once the activity has been completed (successfully or unsuccessfully) control will be passed back to the relevant business process through a callback mechanism. The business process will decide how to proceed based on the result.
The interaction diagram, above, illustrates how this may be accomplished. It involves five actors, the BusinessPrcoess, the Worker, the WorkManagerService and two new integration processes ManageWorkItemProcess and CompleteWorkItemProcess.
- The BusinessProcess is a long running process, which has some manual activities (i.e. approve purchase, review code etc). It sends a request to the ManageWorkItemProcess to manage a particular manual activity.
- The ManageWorkItemProcess interacts with the WorkManagerService and creates a work item. It also stores correlation information into the work item so that a subsequent request to the CompleteWorkItemProcess can locate and signal the originating business process.
- The Worker is responsible for completing the work item, which it will probably accomplish through some web application. The completion of the work item triggers the CompleteWorkItemProcess.
- The CompleteWorkItemProcess retrieves the work item using the WorkManagerService. It then marks the work item as complete again through the Work Manager Service. Finally, it extracts the correlation information from the work item and makes a call to the originating BusinessProcess informing it that the work item has been completed.
This is the simplest use case and does not show any exception or error handling. I am currently using the Oracle Process Manager to develop the ManageWorkItemProcess and the CompleteWorkItemProcess processes but still need to figure out how to support the correlation requirements (i.e. have the CompleteWorkItemProcess send a message to the correct Business Process instance). I also suspect that this will be different across process engine vendor, which will impact the reusability of the ManageWorkItemProcess and CompleteWorkItemProcess processes.