tags:

views:

153

answers:

1

I want to start mutliple Drools Flow processes, but this code blocks:

ksession.startProcess( "com.sample.ruleflow" );

How can I do this?

A: 

StatefulKnowledgeSession.startProcess() blocks only when it reaches a wait state.

If you want the process to run completely asynchronously then you will need to call startProcess() from another thread.

However, with a very simple process (with no possible wait states) it is likely that it will start and end before the next line of code is executed in the current thread, giving an impression of blocking behaviour where in fact there is none.

Matthew Murdoch