This is a wide open question and I am sure there are a number of ways to approach this. I am trying to incorporate jBPM into our application with Mule 3.1. My project mostly deals with messaging so I am receving messages through Mule and I built a selective consumer that basically manages a process engine. This runs as a singleton to prevent multiple process engines from getting started. The selective consumer pulls the required info out of the message and determines if there is a process running that's interested in this message. If so it hands the message off to the process like this:
processInstance.findActiveExecutionIn(activityName);
Map<String, MyObject> parameters =new HashMap<String,MyObject>();
parameters.put("message",msg);
executionService.signalExecutionById(executionId, parameters);
In essence, the selective consumer starts and stops the process so it has the information I need like the processID. I hope this is helpful, if nothing else it is one approach you could take. Let me know if you have any questions. I'm open to suggestions too.
Jim