easy-rules 4.0 发布了

easy-rules 4.0 发布了,基于java8 开发,有好多api 上的变动,以下是一个简单的说明

新特性

  • 添加一个新的领域对象Fact 替换以前的Map<String,Object>
  • Facts 添加了clear 方法
  • 添加了BeanResovler 到SpELAction 以及SpELCondition
  • MVAEL&& Spel 条件如果出现问题,将直接跑出异常(方便调试)
  • Spel 条件以及action使用#{...} 这个早期版本很不规范问题比较多

移动的api

  • RulesEngineParameters has been moved from package org.jeasy.rules.core to org.jeasy.rules.api
  • CompositeRule and its implementations (ActivationRuleGroup, UnitRuleGroup and ConditionalRuleGroup) have been moved from the root package org.jeasy.rules.support to a dedicated package org.jeasy.rules.support.composite
  • RuleDefinitionReader and its implementations (AbstractRuleDefinitionReader, YamlRuleDefintionReader and JsonRuleDefintionReader) have been moved from the root package org.jeasy.rules.support to a dedicated packageorg.jeasy.rules.support.readerzabbix-server-mysql |

删除的api

对于MVEL以及SpEL模块,ParserContext 传到rules 以及rule factories 在构造函数阶段

  • Methods org.jeasy.rules.mvel.MVELRule.when(String, ParserContext) and org.jeasy.rules.mvel.MVELRule.then(String, ParserContext)
  • Methods org.jeasy.rules.mvel.MVELRuleFactory.createRule(Reader, ParserContext) and org.jeasy.rules.mvel.MVELRuleFactory.createRules(Reader, ParserContext)
  • Methods org.jeasy.rules.spel.SpELRule.when(String, ParserContext) and org.jeasy.rules.spel.SpELRule.then(String, ParserContext)
  • Methods org.jeasy.rules.spel.SpELRuleFactory.createRule(Reader, ParserContext) and org.jeasy.rules.spel.SpELRuleFactory.createRules(Reader, ParserContext)
  • Methods org.jeasy.rules.support.AbstractRuleFactory.createSimpleRule(RuleDefinition, ParserContext) and org.jeasy.rules.support.AbstractRuleFactory.createCompositeRule(RuleDefinition, ParserContext) do not take a ParserContext as parameter anymore.

修改的api

因为提供了Fact 领域类型,所有有以下变动

  • Facts#put(String, Object) does not return the previous associated value if any, the return type is now void
  • Facts#remove(String) does not return the removed fact anymore, the return type is now void
  • Facts#iterator now returns a Iterato

说明

后边顺便把以前包装的一个spring boot starter 也升级调整了,4.0 的好多特性还是很不错的

参考资料

https://github.com/j-easy/easy-rules/releases

posted on   荣锋亮  阅读(687)  评论(0编辑  收藏  举报

编辑推荐:
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
阅读排行:
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· 记一次.NET内存居高不下排查解决与启示
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· .NET10 - 预览版1新功能体验(一)
历史上的今天:
2019-05-29 使用terraform 生成自签名证书

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5
点击右上角即可分享
微信分享提示