You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When we try to create a rule using Operand.In the list sent in SetOperand is not being correctly evaluated. The problem seems to be in the Rules.Framework.Providers.InMemory.RuleFactory<TContentType, TConditionType>.CreateValueConditionNode method which, in case the DataType is DataTypes.String, is not considering the possibility that the conditionNodeDataModel.Operand can be an Enumerable:
"System.NotSupportedException: The combination 'one-to-one-In' is not supported.
at Rules.Framework.Evaluation.ValueEvaluation.Dispatchers.ConditionEvalDispatchProvider.ThrowIfUnsupportedOperandsAndOperatorCombination(String combination) in C:\\_git\\rules-framework\\src\\Rules.Framework\\Evaluation\\ValueEvaluation\\Dispatchers\\ConditionEvalDispatchProvider.cs:line 71
at Rules.Framework.Evaluation.ValueEvaluation.Dispatchers.ConditionEvalDispatchProvider.GetEvalDispatcher(Object leftOperand, Operators operator, Object rightOperand) in C:\\_git\\rules-framework\\src\\Rules.Framework\\Evaluation\\ValueEvaluation\\Dispatchers\\ConditionEvalDispatchProvider.cs:line 55
at Rules.Framework.Evaluation.ValueEvaluation.DeferredEval.Eval[TConditionType](IEnumerable`1 conditions, IValueConditionNode`1 valueConditionNode, Object rightOperand, MatchModes matchMode) in C:\\_git\\rules-framework\\src\\Rules.Framework\\Evaluation\\ValueEvaluation\\DeferredEval.cs:line 64
at Rules.Framework.Evaluation.ValueEvaluation.DeferredEval.Eval[TConditionType](IEnumerable`1 conditions, ValueConditionNode`1 valueConditionNode, MatchModes matchMode) in C:\\_git\\rules-framework\\src\\Rules.Framework\\Evaluation\\ValueEvaluation\\DeferredEval.cs:line 42
at Rules.Framework.Evaluation.ValueEvaluation.DeferredEval.<>c__DisplayClass3_1`1.<GetDeferredEvalFor>b__4(IEnumerable`1 conditions) in C:\\_git\\rules-framework\\src\\Rules.Framework\\Evaluation\\ValueEvaluation\\DeferredEval.cs:line 30
at Rules.Framework.Evaluation.Specification.FuncSpecification`1.IsSatisfiedBy(T input) in C:\\_git\\rules-framework\\src\\Rules.Framework\\Evaluation\\Specification\\FuncSpecification.cs:line 14
at Rules.Framework.Evaluation.ConditionsEvalEngine`1.Eval(IConditionNode`1 conditionNode, IEnumerable`1 conditions, EvaluationOptions evaluationOptions) in C:\\_git\\rules-framework\\src\\Rules.Framework\\Evaluation\\ConditionsEvalEngine.cs:line 29
at Rules.Framework.RulesEngine`2.<>c__DisplayClass10_0.<MatchAsync>b__0(Rule`2 r) in C:\\_git\\rules-framework\\src\\Rules.Framework\\RulesEngine.cs:line 272
at System.Linq.Enumerable.WhereListIterator`1.ToList()
at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
at Rules.Framework.RulesEngine`2.MatchAsync(TContentType contentType, DateTime matchDateBegin, DateTime matchDateEnd, IEnumerable`1 conditions, EvaluationOptions evaluationOptions) in C:\\_git\\rules-framework\\src\\Rules.Framework\\RulesEngine.cs:line 271
at Rules.Framework.RulesEngine`2.MatchOneAsync(TContentType contentType, DateTime matchDateTime, IEnumerable`1 conditions) in C:\\_git\\rules-framework\\src\\Rules.Framework\\RulesEngine.cs:line 109
[...]"
Description:
When we try to create a rule using
Operand.In
the list sent inSetOperand
is not being correctly evaluated. The problem seems to be in theRules.Framework.Providers.InMemory.RuleFactory<TContentType, TConditionType>.CreateValueConditionNode
method which, in case theDataType
isDataTypes.String
, is not considering the possibility that theconditionNodeDataModel.Operand
can be anEnumerable
:OS:
Windows 10
.Net SDK:
.Net Standard 2.1
Exception message and stack trace:
A repro of the issue:
Branch with the unit test reproducing the problem
https://github.com/Farfetch/rules-framework/tree/test/inmemory_problem
The text was updated successfully, but these errors were encountered: