j-easy / easy-rules

The simple, stupid rules engine for Java
https://github.com/j-easy/easy-rules/wiki
MIT License
4.83k stars 1.04k forks source link

Allow rules to have optional facts (issue #390) #391

Open nvervelle opened 1 year ago

nvervelle commented 1 year ago

The current code prevents executing a rule if one of the facts listed in the parameters of the condition or the action is missing. It would be nice to be able to modify this behavior so that in some situations missing facts do not prevent the execution of the rule if they are specified as being optional (issue #390).

In this PR I take into account the @Nullable annotation on parameters to consider them as optional.

I know that easy-rules is in maintenance mode, so I'm not sure this PR will be reviewed and merger on master... Can you tell me if it's possible or if I should use a forked release for my needs ? Thanks in advance.