JBoss Community

Re: A question on the external event using event Correlation

created by Jim Hill in jBPM - View the full discussion

I am implementing a similar solution and agree with Mauricio that you need to implement a business layer.  I am not as familiar with Drools and took a different approach which I will describe briefly.  I implemented the Selective Consumer pattern as described in Hohpe and Woolf's Enterprise Integration Patterns book.  In my case processes were started before the business key was assigned, so my messages do not always pass around the same business key.  This makes it harder to link them back to a running instance of a process.  I ended up writing a manager component in mule that receives JMS messages that may need to go to JBPM processes.  This component manages the start and end of process instances.  When it receives a messages it extracts the business key from the message and looks to a self contained map to determine if this key is related to an active process. If we find a match I pass the message to the active state in the process.  These are defined as custom nodes in the process.  The class implements ExternalActivityBehavior.  It is responsible for making sure it received the right message.  The value it returns is used by a decision node to determine if we need to keep waiting or can move on to the next wait state.

 

This is just one approach.  I welcome feedback from those who have been at this longer than I have.  It is working for me, but I am struggling with group timers which I am trying to implement in order to kill the process if the right message does not show up in a specified period of time.  Hope this adds an option for you to pursue.


Jim

Reply to this message by going to Community

Start a new discussion in jBPM at Community