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 的好多特性还是很不错的
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· 记一次.NET内存居高不下排查解决与启示
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· .NET10 - 预览版1新功能体验(一)
2019-05-29 使用terraform 生成自签名证书