Monday, March 21, 2011

BPM 11g and Notifications

Simple scenario I want to send an email Notification from my BPM process informing a customer that her order has been approved.

I am using JAMES for this simple scenario –

I created the users –

• bpelsender/welcome1
• jcooper/welcome1

Email Setting as follows –








I created a new BPM app in JDev and included the following myOrders.xsd

-------------------



-------------------

• Add Order definition to the Business Catalog



Create a Process Data Object v_order, based on the Order type.

• Start Activity --> Implementation --> Define Interface







• Add a User task to approve large orders (Large order >= 10000)






• Add a BPEL process to the composite



Add an EMAIL activity



All we are really interested in is – NotificationService.wsdl & NotificationService.xsd.



• So we can delete the BPEL process



• Implement NotifyCustomer





• Deploy & test





• Check email inbox

Wednesday, March 9, 2011

Correlation with BPM 11g - cancelling a running instance

Scenario:

My esteemed colleague Angelo and I got this example together...

So what did we do?

We thought up the following simple scenario -
An order is passed on to a Salesperson for approval.
However, the customer can cancel the order while it is in flight.

So essentially we need to cancel a running BPM process based on an event -
So while our BPM process is doing it's thing, we also want to "listen" for any relevant "cancel" messages.




Steps

So what did we do?

We created a simple BPM app that included a User task to approve the order.
The BPM app will also start an instance of the listening BPEL process.



The BPM app will also contain an event handler that listens for a cancellation message from BPEL.

The simple BPEL process that will listen for cancellations -



We amended the BPEL wsdl to define the "cancelMsg" type and also included 2 new operations for the cancel - 1. to "receive the cancel", the other to do the cancel callback.

We created a correlation set on the Receive activity.
This is also leveraged by the OnMessage, which captures the cancellation and does the required callback.

Full doc and JDev project at -

https://docs.google.com/document/d/1tIYeEZM1kBmf2piGaeE5U0-59nGyQKaBand5kET-wUg/edit?hl=en&authkey=CJrT2pYK

and

https://docs.google.com/leaf?id=0B7YrnfO7h717ZDNjYTZmYWUtMDAxMy00MDIxLWExOGYtMWY0YzI5MWQxMzVi&hl=en&authkey=CIaZwMQL