JBoss Community

Re: When does Session.startProcess() return?

created by Mauricio Salatino in jBPM - View the full discussion

About the Drools question, I don't think drools works on the way that you mention.

I'm not sure why are you asking about stateless sessions if you are running processes inside the session, you should be working with stateful sessions.

Drools works as follow:

You insert facts to the working memory. At that point all the rules related with that type of facts are analyzed and activations can be created (if the when part of one rule matches completly). Then when you call the fireAllRules() method, all the activations that were generated will be executed. That execution can cause more activations to be generated. At that point you can have a little bit of recursion caused by the inferences that are being done by the engine, but it shouldn't take too much time. It really depends on your use case, but Drools will not be waiting for matching all the rules blocking your application thread. It will run all the things that it can and after that it will return the control to your application.

 

Hope it helps!

Greetings!

Reply to this message by going to Community

Start a new discussion in jBPM at Community