Drools Fusion支持持久,长时间运行的事件 [英] Drools Fusion support for persistent, long running events

查看:135
本文介绍了Drools Fusion支持持久,长时间运行的事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在考虑使用 Drools Fusion 来实施以下示例规则:

I was considering using Drools Fusion to implement the following exemplary rules:


  • 如果客户在一年内购买了两件相同的产品,她将免费获得第三件

  • 支出​​更多

  • a当客户处于非活动状态超过一年时,客户获得折扣时,最多连续三次交易超过200美元

  • 当一个订单大于最后六个monhts中的平均订单价值时,主管会收到通知

  • ......等等,这些只是我头脑中的例子

  • if customer bought two same products within a year, she gets third for free
  • for spending more than 200 USD in at most three consecutive transactions customer gets a discount
  • when the customer is inactive for more than a year a reminder is generated
  • a supervisor is notified when a single order is greater than an average order value within last six monhts
  • ...and so on, these are just examples from the top of my head

所有这些规则都可以使用Drools Fusion轻松表达。然而,在创建原型并查看文档之后,看起来这个产品更适合短期,短暂的事件(股票市场,实时决策)。

All these rules can be easily expressed using Drools Fusion. However after creating a prototype and reviewing the documentation it seems like this product is better suited for short-term, transient events (stock market, real-time decision making).

问题是:是否需要将所有事件存储在内存中?(可能是数百万的旧购买)。此外可以Drools Fusion存储事件,以便它们能够在服务器重启后继续存在吗?(理想情况下在数据库中)。

The question is: is it required to store all events in memory? (possibly millions of very old purchases). Moreover can Drools Fusion store events so that they survive server restart? (Ideally in the database).

我知道Drools Fusion事件只是事实在 Drools Expert ,所以也许这个问题可以扩展到:可以Drools Expert持续存在且延迟加载事实吗?

I know Drools Fusion events are simply facts in Drools Expert, so maybe the question can be expanded to: can Drools Expert persist and lazily load facts?

推荐答案

你可以做的是加载每次您为该客户获得新交易时,每个客户的历史信息。或定期加载信息以查看不活跃的客户。
你提到的所有例子对我来说都是事实。显然,你可以将所有内容建模为事件,但正如你所提到的,这将导致你需要将所有内容都存储在内存中。
要回答关于存储/处理数百万个事件的问题,首先需要回答问题,如果JVM支持在内存中包含所有这些对象。

What you can do is to load the history information per customer each time that you get a new transaction for that customer. Or periodically load the information to review inactive customers. All the examples that you mention looks like Facts to me. Obviously that you can model everything as events, but as you mention that will cause that you will need to have everything in memory. To answer your question about store/handle million of events, you first need to answer the question if the JVM will support to have all those objects in memory.

干杯

这篇关于Drools Fusion支持持久,长时间运行的事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆