Skip to content

Commit

Permalink
updated System.Linq.Dynamic.Core to 'fix' improperly used literal not…
Browse files Browse the repository at this point in the history
…ation
  • Loading branch information
asulwer committed Jun 25, 2024
1 parent b07dd3e commit 789661c
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 12 deletions.
22 changes: 13 additions & 9 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,28 @@

All notable changes to this project will be documented in this file.

## [6.0.3]
- updated System.Linq.Dynamic.Core to fix a bug [614](https://github.com/microsoft/RulesEngine/issues/614)
- created test CachingLiteralsDictionary to verify bug has been fixed

## [6.0.2]
- CancellationToken was not completely implemented
- Release builds are strongly signed
- CancellationToken was not completely implemented
- Release builds are strongly signed

## [6.0.1]
- All previous RulesEngine public methods have labeled obsolete (but still exist for backwards compatibility)
- Replacement methods created which prevent confusion [Example](https://github.com/asulwer/RulesEngine/blob/main/demo/DemoApp/Demos/MultipleWorkflows.cs)
- All previous RulesEngine public methods have labeled obsolete (but still exist for backwards compatibility)
- Replacement methods created which prevent confusion [Example](https://github.com/asulwer/RulesEngine/blob/main/demo/DemoApp/Demos/MultipleWorkflows.cs)
- `public async IAsyncEnumerable<List<RuleResultTree>> ExecuteAllWorkflows(object[] inputs, [EnumeratorCancellation] CancellationToken ct = default)`
- `public async IAsyncEnumerable<List<RuleResultTree>> ExecuteAllWorkflows(RuleParameter[] inputs, [EnumeratorCancellation] CancellationToken ct = default)`
- interates workflows and calls ExecuteWorkflow for each interation
- yield return for each workflow
- interates workflows and calls ExecuteWorkflow for each interation
- yield return for each workflow
- `public async Task<List<RuleResultTree>> ExecuteWorkflow(string workflow_name, object[] inputs, CancellationToken ct = default)`
- `public async Task<List<RuleResultTree>> ExecuteWorkflow(string workflow_name, RuleParameter[] inputs, CancellationToken ct = default)`
- interates rules in workflow and calls ExecuteRule for each iteration
- interates rules in workflow and calls ExecuteRule for each iteration
- `public async Task<RuleResultTree> ExecuteRule(string workflow_name, string rule_name, RuleParameter[] ruleParams, CancellationToken ct = default)`
- executes a rule and/or action, if applicable
- executes a rule and/or action, if applicable
- `public async Task<ActionRuleResult> ExecuteRuleActions(string workflow_name, string rule_name, RuleParameter[] inputs, CancellationToken ct = default)`
- execute the actions of a rule
- execute the actions of a rule
## [6.0.0]
- methods that were marked obsolete, in prior version, have been removed
Expand Down
2 changes: 1 addition & 1 deletion ROADMAP.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Roadmap for RulesEngineEx, formerlly known as [RulesEngine}(https://github.com/microsoft/RulesEngine).
### Roadmap for RulesEngineEx, formerlly known as [RulesEngine}(https://github.com/microsoft/RulesEngine).

- WorkflowName and RuleName will be changed to Name
- seems redundant to say Workflow.WorkflowName or Rule.RuleName
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@

using Newtonsoft.Json.Linq;
using RulesEngine.ExpressionBuilders;
using RulesEngine.Models;
using System;
using System.Diagnostics.CodeAnalysis;
using Xunit;
using static FastExpressionCompiler.ExpressionCompiler;

namespace RulesEngine.UnitTest.RuleExpressionParserTests
{
Expand Down Expand Up @@ -50,6 +53,33 @@ public void TestExpressionWithJObject()
Assert.Equal("helloworld", value3);
}

[Fact]
public void CachingLiteralsDictionary()
{
var board = new { NumberOfMembers = default(decimal?) };

var parameters = new RuleParameter[] {
RuleParameter.Create("Board", board)
};

var parser = new RuleExpressionParser();

try
{
const string expression1 = "Board.NumberOfMembers = 0.2d";
var result1 = parser.Evaluate<bool>(expression1, parameters);
Assert.False(result1);
}
catch (Exception)
{
// passing it over.
}

const string expression2 = "Board.NumberOfMembers = 0.2"; //literal notation incorrect, should be 0.2m
var result2 = parser.Evaluate<bool>(expression2, parameters);
Assert.False(result2);
}

[Theory]
[InlineData(false)]
public void TestExpressionWithDifferentCompilerSettings(bool fastExpressionEnabled){
Expand Down
4 changes: 2 additions & 2 deletions RulesEngine/RulesEngine.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<TargetFrameworks>netstandard2.1</TargetFrameworks>
<Nullable>disable</Nullable>
<Version>6.0.2.1</Version>
<Version>6.0.3</Version>
<PackageId>RulesEngineEx</PackageId>
<Copyright>Copyright (c) Aaron Sulwer.</Copyright>
<Company>ACCLS Company</Company>
Expand Down Expand Up @@ -48,7 +48,7 @@
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="System.Linq.Dynamic.Core" Version="1.4.1" />
<PackageReference Include="System.Linq.Dynamic.Core" Version="1.4.2" />
</ItemGroup>

<Target Name="PostBuild" AfterTargets="PostBuildEvent" Condition="'$(Configuration)' == 'Release'">
Expand Down

0 comments on commit 789661c

Please sign in to comment.