JBoss Community

Message Events in statefully flows

reply from Kris Verlaenen in JBoss Tools - View the full discussion

Rob,

 

You should signal your flow about the occurence of an event using processInstance.signalEvent(name, value);

So the problem is, how do I find the right process instance to signal?

 

Drools Flow currently does not allow for automatic correlation of messages.  You can however use the processInstanceId for correlation purposes:

 

a) store the process instance id as part of your domain model, when the event occurs due to a change of one of your facts, you can simply retrieve the process instance id from the fact

 

b) you can maintain a separate table that maps process instance id to some other domain data (like for example a fact id), so that you can lookup the process instance id like this.

 

We'll be looking at how to provide more automatic correlation mechanisms as part of the BPMN2 implementation.

 

Kris

Reply to this message by going to Community

Start a new discussion in JBoss Tools at Community