开发者

StatelessKnowledgeSession and Drools Flow

开发者 https://www.devze.com 2023-02-28 02:24 出处:网络
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

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消