Integrating my Work Manager with a Business Process Engine
by Jim Alateras
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.
Correlation and engine independence
Correlation is a BPEL spec thing, and is completely independent of engine implementation. You specify the message properties and property aliases in the WSDL---that's a BPEL extension to the WSDL spec. Then you use those in your BPEL to create correlation sets. A correlation set is a chunk of data that gets passed around as part of your normal Web service messages. The contents of the correlation set are used by the engine to determine which process instance is the target of the message. The way that works is internally engine-specific, but you as a user of the engine don't care. Your use of the correlation data will be the same no matter which engine you use.
Your BPEL Experiment
This is a great foundation point for a generic evaluation of what can be achieved across a range of current BPEL Engines. It would be great if the process specs could be unveiled so that others BPEL engine providers like ourselves could showcase our Engine implementing your process flow without problems with Correlation sets (*This is standard BPEL*) for instance.