简体   繁体   English

如何在drools bpmn2文件中获取Spring Bean?

[英]How to get a Spring Bean inside drools bpmn2 file?

I am working on Spring Boot and drools.我正在研究 Spring 引导和流口水。

In drools, I am using bpmn2 files and want to use Spring beans.在 drools 中,我正在使用 bpmn2 文件并想使用 Spring bean。 I have tried different ways including:我尝试了不同的方法,包括:

  • Setting Global and using it inside bpmn.设置全局并在 bpmn 中使用它。
  • Inserting variable inside ksession and getting kcontext.getVariable inside bpmn.在 ksession 中插入变量并在 bpmn 中获取 kcontext.getVariable。
  • injecting applicationContext inside session and using it in bpmn在 session 中注入 applicationContext 并在 bpmn 中使用它

But none of it has worked, Could you please help me with a working example for the same?但它都没有奏效,你能帮我举一个同样的例子吗?

Regards,问候,

ihave questions ihave 100 rules and all of them calling the same method in when conditions and this method get list of values from database so when drools engine check in my rules will calling the data base 100 times even it,s fired one rule only so what is the soultions我有问题我有 100 条规则,它们都在 when 条件和此方法从数据库中获取值列表时调用相同的方法,因此当流口水引擎检查我的规则时,即使它也会调用数据库 100 次,只触发了一条规则,那又如何是灵魂深处

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM