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
@grefus I just tested this scenario using code approach and it works fine for me. check if your rules are formatted properly when loading from the JSON file. Also, please include the code does not screenshot. It's very hard to understand those screenshots.
publicclassGitHubTimeDifference{publicstaticasyncTaskRun(){varworkflows=newWorkflow[]{new(){WorkflowName="AlarmWorkflow",Rules=[newRule{RuleName="CheckWithToString Convert",RuleExpressionType=RuleExpressionType.LambdaExpression,Expression="(d2 - d1).TotalMinutes > 15",ErrorMessage="Time is not greater than 15 minutes",}]}};vard1=DateTime.Now;vard2=DateTime.Now.AddMinutes(20);varruleParameters=newRuleParameter[]{new("d1",d1),new("d2",d2)};RE.RulesEnginerulesEngine=new(workflows);varresultList=awaitrulesEngine.ExecuteAllRulesAsync("AlarmWorkflow",ruleParameters);foreach(varresultinresultList){Console.WriteLine($"Rule: {result.Rule.RuleName}, Result: {result.IsSuccess}, Message: {result.ExceptionMessage}");}}}
When I try to calculate the TotalMinutes of the time difference between two DateTime values, it always results in an error.Here is my code below.



The text was updated successfully, but these errors were encountered: