Changelog History
Page 1
-
v4.1.0 Changes
December 06, 2020๐ This version is a minor release which comes with the following new features, enhancements and bug fixes:
๐ New features
- Issue #283: Add
size
method inRules
API - โก๏ธ Issue #288: Update
Rules#register
/Rules#unregister
methods to accept varargs - ๐ Issue #271: Add support for Apache JEXL
๐ Bug fixes
- โก๏ธ Issue #291: Update
RuleProxy
to accept types implementingComparable
๐ Documentation
- โก๏ธ Issue #316: Update Javadoc about rule comparison
- Issue #320: Document composite rules about their thread unsafety
๐ I would like to thank all contributors who helped making this release possible!
- Issue #283: Add
-
v4.0.0 Changes
May 17, 2020๐ This is a major release which is based on Java 8. This version comes with a number of new features and bug fixes (See detailed list below). Moreover, some breaking changes have been introduced to fix a couple of design inconsistencies in v3. Here are the major changes:
- ๐ Introducing a new
Fact
domain concept which replaces theMap<String, Object>
data structure used in v3. This new concept has a number of advantages like type safety, better encapsulation and a cleaner API. - โ
MVEL/SpEL conditions now throw runtime exceptions instead of catching them and returning
false
. This makes it possible to correctly unit test conditions as well as listen to evaluation errors with a rule listener (a new methodRuleListener#onEvaluationError
has been introduced for this purpose). - ๐ง SpEL conditions and actions should now use the
#{ ... }
template by default. This is configurable but it has been made the default to be consistent with Spring's default template parser.
โฌ๏ธ Moreover, thanks to this major Java version upgrade, a lot of improvements have been introduced in the API (like using default methods in interfaces, adding
@FunctionalInterface
where appropriate, etc) as well as in the code base (using lambdas and streams where it made sense, using new reflection APIs introduced in Java 8, etc).๐ Here is the list of issues resolved in this release:
๐ New features
- issue #276: Add
Fact
concept - issue #250: Add a
clear
method inFacts
API - issue #259: Add
BeanResolver
toSpELAction
andSpELCondition
๐ Bug fixes
- issue #267:
Facts#asMap
should return an immutable map or a copy of the facts - issue #211:
MVELCondition
does not re-throw exceptions - issue #257: Inconsistent SpEL expression templating between
SpELRule
andSpELRuleFactory
โจ Enhancements
- ๐ issue #268: Improve Javadoc of
Facts#iterator
to mention that it should not be used to remove facts - 0๏ธโฃ issue #253: Add default methods in interfaces
๐ I would like to thank all contributors who made this release possible by reporting issues, testing fixes, requesting features and participating in discussions: @readilychen, @elitacco, @snok3r, @AleksandrPalchuk, @turiandras, @Alexey1Gavrilov, @yunfengwang and @R-Gerard ! Thank you all for your contributions!
A special BIG thank you to @zhhaojie for following up on issues, helping in design discussions and all the time and effort put on Easy Rules!
Migration guide from v3 to v4
๐ Moved APIs
๐ฆ The following APIs have been moved between packages for better cohesion:
- ๐ฆ
RulesEngineParameters
has been moved from packageorg.jeasy.rules.core
toorg.jeasy.rules.api
- ๐ฆ
CompositeRule
and its implementations (ActivationRuleGroup
,UnitRuleGroup
andConditionalRuleGroup
) have been moved from the root packageorg.jeasy.rules.support
to a dedicated packageorg.jeasy.rules.support.composite
- ๐ฆ
RuleDefinitionReader
and its implementations (AbstractRuleDefinitionReader
,YamlRuleDefintionReader
andJsonRuleDefintionReader
) have been moved from the root packageorg.jeasy.rules.support
to a dedicated packageorg.jeasy.rules.support.reader
Action: Update import statements where the aforementioned classes are used
โ Removed APIs
๐ For both MVEL and SpEL modules, the
ParserContext
is now passed to rules and rule factories at construction time. Hence, all overloaded methods where the parser context is passed as a parameter (which are now useless) have been removed:- ๐ Methods
org.jeasy.rules.mvel.MVELRule.when(String, ParserContext)
andorg.jeasy.rules.mvel.MVELRule.then(String, ParserContext)
- ๐ Methods
org.jeasy.rules.mvel.MVELRuleFactory.createRule(Reader, ParserContext)
andorg.jeasy.rules.mvel.MVELRuleFactory.createRules(Reader, ParserContext)
- ๐ Methods
org.jeasy.rules.spel.SpELRule.when(String, ParserContext)
andorg.jeasy.rules.spel.SpELRule.then(String, ParserContext)
- ๐ Methods
org.jeasy.rules.spel.SpELRuleFactory.createRule(Reader, ParserContext)
andorg.jeasy.rules.spel.SpELRuleFactory.createRules(Reader, ParserContext)
- ๐ Methods
org.jeasy.rules.support.AbstractRuleFactory.createSimpleRule(RuleDefinition, ParserContext)
andorg.jeasy.rules.support.AbstractRuleFactory.createCompositeRule(RuleDefinition, ParserContext)
do not take aParserContext
as parameter anymore.
Action: Pass the parser context at construction time (to the rule or the rule factory) and call new methods that do not take the parser context as parameter.
๐ Changed APIs
Due to the introduction of the new
Fact
concept (issue #276), the following method signatures have been changed:Facts#put(String, Object)
does not return the previous associated value if any, the return type is nowvoid
- ๐
Facts#remove(String)
does not return the removed fact anymore, the return type is nowvoid
Facts#iterator
now returns aIterator<Fact>
instead ofIterator<Map.Entry<String, Object>>
Actions:
- โก๏ธ Update the assigned variable type where those methods are called.
- ๐ For
Facts#put
, since the previously associated value if any is not returned anymore, one can query theFacts
API to see if there is a fact mapped for the given name before callingput
. - ๐ For
Facts#remove
, since the removed fact is not returned anymore, one can query theFacts
API
to get the fact before removing it.
- ๐ Introducing a new
-
v3.4.0 Changes
December 08, 2019๐ This is a minor release with a few enhancements and bug fixes:
โจ Enhancements
- Issue #221: RuleProxy can be speed up by caching reflective access
- Issue #238: Make
AbstractRulesEngine
public - ๐ Issue #223: Remove
DefaultRuleListener
andDefaultRulesEngineListener
๐ Bug fixes
- Issue #239: RulesEngine listeners are not invoked when registered in an
InferenceRulesEngine
๐ Many thanks to all contributors for their help in this release!
๐ โ๏ธ Please note that this is the last release in the v3 line. Next version will be 4.0.0 and will be based on Java 8.
-
v3.3.0 Changes
April 25, 2019๐ This release is a minor version with the following changes:
๐ Features and enhancements
- ๐ #156: Add composite rule support from a rule descriptor file
- 0๏ธโฃ #166: Change default log level to
DEBUG
- ๐ #197: Add support for parser context in MVEL conditions/actions
- ๐ #202: Add support to read rules from JSON objects
- ๐ #204: Add support for Spring Expression Language
๐ Bug fixes
- #157:
RulesEngine#getListeners
andRulesEngine#getRulesEngineListeners
should return a unmodifiable list of listeners - #158:
RulesEngine#getParameters
should return a copy of the parameters - #165: Incorrect rule validation for non annotated fact parameters
- #194:
MVELAction
does not re-throw exceptions - #203:
ConditionalRuleGroup
has wrong priority control
โ๏ธ Heads-up: Even though this is a minor release, there is a small breaking change in the
MVELRuleFactory
API. It was not possible to introduce SpEL and JSON support without introducing this breaking change, and waiting for a major release (Java 8 baseline) did not make sense. Semantic versioning rules are not as easy to implement as Easy Rules ๐๐ Many thanks to @Jeff-Jia, @wuhaidu, @khaledabderrahim, @ramnaresh2051, @kayeight, @amitvj1 and @mr0815mr for their contributions to this release!
-
v3.2.0 Changes
April 09, 2018๐ This is the second maintenance release of the 3.x line. It introduces a new module called
easy-rules-support
. This module contains support classes that were in theeasy-rules-core
module. For instance, theorg.jeasy.rules.core.CompositeRule
has been moved toeasy-rules-support
asorg.jeasy.rules.support.CompositeRule
and made abstract. 3 implementations of composite rules are now provided out of the box:UnitRuleGroup
: All or nothing semantics ( exactly the same asCompositeRule
in previous versions)ActivationRuleGroup
: XOR logic, ie only one rule of the group will be triggered (issue #122)ConditionalRuleGroup
: A primary rule acts as a precondition to trigger the rule group (issue #130)
๐ This release comes with other new features and some bug fixes:
๐ Features
- Issue #96: Set priority through
@Rule
annotation - Issue #133: Read YAML rule descriptor from a String
- Issue #138: Load multiple rules from a single yaml file
๐ Bug fixes
- Issue #139: NPE If a null Fact is injected through annotation
- Issue #143: Proxy
toString()
is not equal to original objecttoString()
- Issue #141: NPE in
MVELRuleDefinitionReader
if rule name, description or priority is not specified
๐ Deprecations
- ๐ Issue #145: Deprecate
MVELRuleFactory#createRuleFrom(java.io.File)
. A new method that takes ajava.io.Reader
is to be used instead to be able to read rules not only from files (with aFileReader
), but also from Strings (with aStringReader
) or any other reader implementation. - ๐ Issue #122:
org.jeasy.rules.core.CompositeRule
is deprecated. It has been moved to the neweasy-rules-support
module and is now abstract.
๐ I would like to thank @dagframstad, @danrivcap, @bpoussin and @paulbrejla for their contributions to this release.
-
v3.1.0 Changes
December 18, 2017๐ This release is another important milestone for Easy Rules! We finally managed to get some long awaited features out ๐
The major additions of v3.1 are:
- ๐ New inference rules engine
- ๐ New
Condition
,Action
andRuleBuilder
APIs - ๐ Support for using expression language to define rules
๐ This release has also introduced a lot of API improvements thanks to some amazing contributors! Here is the full list of changes:
๐ Features:
- issue #36: Use Expression Language to define rules
- issue #88: Add inference rules engine
- ๐ฒ issue #113: Use SLF4J instead of java.util.logging
- issue #121: Add rules engine listener
- issue #119: Add
Condition
/Action
APIs
๐ Bug fixes:
- ๐ issue #91: Log performance in silent mode
- issue #100: Rule proxy's equals return unexpected result
โจ Enhancements
- issue #123: cast friendly Facts
- ๐จ issue #118: Use toString() to print engine parameters
- ๐ issue #111: Remove unnecessary method and interface
- issue #115: Override equals()/hashCode()/toString() same as BasicRule
- issue #104: [subFacts]: Conditions or Actions can have subclass of Facts as parameter
- issue #95: Improve the Facts api
- issue #94: A little optimization in RuleProxy.java
๐ Deprecations
- ๐ issue #126: Deprecate RulesEngineBuilder
- issue #91: Methods
RulesEngineParameters#setSilentMode
andRulesEngineParameters#isSilentMode
as well as constructors takingsilentMode
parameter
I would like to thank @wg1j, @sanmibuh, @shivmitra, @cemo and @khandelwalankit for their contributions!
-
v3.0.0 Changes
May 30, 2017This is a big milestone for Easy Rules since the beginning! v2.x was a successful line but we must admit it suffered from a couple of design decisions:
- Rules were designed to encapsulate data (BOM) they operate on. This works fine, but is not very friendly to concurrent threads
- The rules engine was designed to encapsulate the set of rules it operates on. For the same reason as 1) , this make the engine not thread safe
v3 is finally here to fix these issues! Please find below the most important changes and additions.
Important notes about v3
Easy Rules is now part of the jeasy project. Hence, the maven's
groupId
has changed fromorg.easyrules
toorg.jeasy
๐ Online documentation has been moved from
www.easyrules.org
to the wiki of the github project. Thewww.easyrules.org
site will be shutdown on 31/07/2017.๐ Gitter chat room has been moved from
https://gitter.im/easyrules/easyrules
to https://gitter.im/j-easy/easy-rulesMajor changes
- issue #37 : Add working memory abstraction through the
Facts
API - issue #86 : Add rules set abstraction through the
Rules
API - issue #87 : Add
@Fact
annotation to inject facts in conditions and actions methods of rules
โก๏ธ The
DefaultRulesEngine
class is now public. Keys APIs (Rule
,RulesEngine
andRuleListener
) have been updated to acceptRules
andFacts
in their methods signatures. Please refer to the javadoc for all details about these changes.๐ Deprecations
- ๐ issue #79 : deprecate rules engine name parameter
- ๐ issue #74 : remove spring support that was deprecated in v2.5
- ๐ issue #75 : remove quartz support that was deprecated in v2.5
๐ This release would not have been possible without the help of some awseome contributors! We are grateful to all of them! Thank you for your time and effort.
-
v2.5.0 Changes
May 18, 2017โ This is the latest version in v2.x line. It adds the following features and bug fixes:
๐ Features
- issue #64 : Add ability to unregister a rule by name
- issue #65 : Add Spring Boot Starter for Easy Rules
- issue #72 : Add ability to get notified with rule evaluation result in the
RuleListener
API
๐ Fixed bugs
- issue #66 : Core annotations are not inherited in child classes
- issue #68 :
@SpringRule
annotation is not inherited in child classes
๐ In this version, support for Spring and Quartz has been deprecated and will be removed in v3.0.
โ Many thanks to @khandelwalankit, @cogito-clarus, @careerscale, @cgonul, @pklovesbacon and @yisraelU for reporting issues and testing fixes.
A special thank to @andersonkyle for adding a spring boot starter to easy rules!
A big thank goes to @will-gilbert for implementing easy rules tutorials with groovy! -
v2.4.0 Changes
February 08, 2017๐ This is a minor release with the following changes:
๐ Features
- issue #52: add
skipOnFirstNonTriggeredRule
parameter
๐ Bug fixes
- issue #57: incorrect sorting of rules when
BasicRule.getPriority
method is overridden
โจ Enhancements
- issue #63:
Utils
class should not be public
๐ Deprecations
- ๐ issue #47: JMX support has been deprecated in v2.3 and removed in this version
Many thanks to all contributors, especially @toudidel and @spearway and @JurMarky, for reporting issues, fixing bugs and implementing features.
- issue #52: add
-
v2.3.0 Changes
August 24, 2016๐ New features
- issue #34 : add method
beforeEvaluate
inRuleListener
- issue #39 : add method
getListeners
inRulesEngine
to get registered listeners - issue #40 : add method
checkRules
inRulesEngine
to check rules without firing them - issue #41 : add possibility to create composite rules from annotated rules
๐ Fixed bugs
- issue #32 : unable to use Easy Rules in android due to JMX
- issue #38 : unable to set rules engine name in spring factory bean
๐ Improvements
- ๐ฒ issue #46 : improve JUL log record format
๐ Deprecation
- ๐ issue #47 : deprecate JMX managed rules and rules engine
- issue #34 : add method