Farfetch / rules-framework

A generic framework that allows defining and evaluating rules for complex business scenarios.
MIT License
40 stars 7 forks source link

RQL (part 1) - Match and search expressions #166

Open luispfgarces opened 3 months ago

luispfgarces commented 3 months ago

Description

Creates the Rule Query Language core language on top of the Rules.Framework rules engine, adding support for match and search expressions.

Some examples of the language usage (using the integration tests scenario 8 - poker combinations):

MATCH ONE RULE FOR "TexasHoldemPokerSingleCombinations" ON $2023-01-01Z$;

match one rule for "TexasHoldemPokerSingleCombinations" on $2023-01-01Z$ when { @NumberOfKings is 1, @NumberOfQueens is 1, @NumberOfJacks is 1, @NumberOfTens is 1, @NumberOfNines is 1, @KingOfClubs is true, @QueenOfDiamonds is true, @JackOfClubs is true, @TenOfHearts is true, @NineOfSpades is true };

SEARCH RULES FOR "TexasHoldemPokerSingleCombinations" SINCE $2023-01-01Z$ UNTIL $2023-01-31Z$ when { @NumberOfKings is 3 };

search rules for "TexasHoldemPokerSingleCombinations" since $2023-01-01Z$ until $2023-01-31Z$ when { @NumberOfAces is 5 };

It is also added a simple RQL commands prompt to the Web UI (sample image using the Web UI sample on the solution).

rql-screenshot

Related to #152.

Change checklist

Please also check the I want to contribute guidelines and make sure you have done accordingly.

Disclaimer

By sending us your contributions, you are agreeing that your contribution is made subject to the terms of our Contributor Ownership Statement

luispfgarces commented 2 months ago

Beta package generated: https://www.nuget.org/packages/Rules.Framework.Rql/3.0.0-beta.1