Comments (2)
oh yeah, now the result is different, I must have missed something.
Additionally, what I forgot about is that the type was decimal?
and needed to do Item.Value.Value
.
from rulesengine.
you don't need to add the Math to your RESettings:
here's a sample using RuleExpressionParser
var parameter = new RuleParameter("Board", new { Item = new { Value = 10 } });
var parser = new RuleExpressionParser(new ReSettings());
const string expression = @"Math.Min(Item.Value, 20)";
var result = parser.Evaluate<decimal>(expression, new[] { parameter });
Console.WriteLine(result);
from rulesengine.
Related Issues (20)
- Getting exception by using NetTopologySuite objects inside rule expression HOT 2
- Comparisons with nullable types HOT 6
- .Net8 HOT 2
- Is it possible to get the RulesEngine instance in the custom Action? HOT 1
- New Operators: SequentialAnd and SequentialOr HOT 4
- GlobalParams HOT 1
- Handling of List type child property HOT 5
- Are there future plans to support multiple success or fail actions? HOT 4
- Pass additionalInputs to EvaluateRule Action HOT 1
- How to do nested if else HOT 3
- Using OnSuccess/OnFailure Actions within a rule causes a NullReferenceException when the Context is not defined
- Utils.GetTypedObject fails to type lists of objects with nullable values HOT 2
- Using inputFilter and additionalInputs functionality issues HOT 1
- Compiling rules into JS - is it supported/planned?
- RulesEngine lifetime and thread-safety HOT 4
- Custom Name of Parameter not being honored. HOT 2
- Unexpected True Result from Expression Evaluation with Default ReSettings
- Custom method is not being called with ExecuteActionWorkflowAsync; throwing parser error. HOT 1
- Rule Engine
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rulesengine.