【问题标题】:How to get logically inserted fact or insrt fact in code in Drools guvnor如何在 Drools guvnor 的代码中获取逻辑插入的事实或插入事实
【发布时间】:2013-04-19 03:41:30
【问题描述】:

我的 guvnor 规则是这样的:

Rule "aa" 
 dialect "mvel" 
  when 
    Fund( amount> 10000 ) 

then 
 Alert fact0 = new Alert(); 
 fact0.setSummary( "hi" ); 
 insert( fact0 ); 
end 

并使用无状态知识会话。现在我想在代码中得到fact0。如何做到这一点?
请帮帮我。

【问题讨论】:

    标签: drools guvnor


    【解决方案1】:

    最容易流口水的方法是使用查询。另一种选择是使用 ksession.getObjects()。你可以看看这个答案:Retrieving facts of a specific type from working memory

    希望对你有帮助,

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-03-08
      相关资源
      最近更新 更多