StatelessKnowledgeSession and Drools Flow
Is it possible to run a Drools Flow process from a StatelessKnowledgeSession
? If so, how? It doesn't have the startProcess(id, params)
method and seems to only implement rule functionality. I have a service whose method runs a process. So far, I've used one StatefulKnowledgeSe开发者_运维百科ssion
but I read that it's not thread-safe. One solution I came up with is to inject a knowledge base and create a new session for every call of this method, but that seems like a waste of resources.
Completing the other answer, you can use like this:
ksession.execute(CommandFactory.newStartProcess(theName, parameters));
StatelessKnowledgeSession has a method execute(..) where you can pass a set of commands. One of those could be a startProcess command.
精彩评论