Replies: 7 comments
-
@jetfreakk thanks for this suggestion. Could you expand on this concept? Thanks |
Beta Was this translation helpful? Give feedback.
-
Range Rule Example:
I have also cloned regola and implemented a first draft of the same if that helps. |
Beta Was this translation helpful? Give feedback.
-
Some ideas... Rather than have inclusideMin/inclusiveMax, might be good to define a set of operations to be consistent with the other rules. In the future, we could potentially consider having other operations too. For example, one that compares ranges and determines if a range included, overlaps, etc... A limitation of this proposal is that it works for integers only. Should it work for alphanumerical values too? What about doubles? Feel free to share a fork of your implementation. I will be happy to have a quick look ahead of any PR. |
Beta Was this translation helpful? Give feedback.
-
That sounds like a good idea too. I am assuming by some mentioned operations you mean the following (Tried drafting some examples of the operations)
I have made use of "Numbers" so it should support Integers and Doubles. I don't see the use case of alphanumeric for this case. (Not sure how alphanumeric will come into picture here) Sure,here is the fork. |
Beta Was this translation helpful? Give feedback.
-
Additional Note :- The Above example of Operations is Range to Range comparision (Overlapping, sub-range, etc) . The one I was thinking about is more on the lines of a fact lying inside a rule and the fact being a Number (Example, 5 lies in [5,10]. |
Beta Was this translation helpful? Give feedback.
-
@jetfreakk can you open a PR from your fork so I can start reviewing your proposals? Thanks |
Beta Was this translation helpful? Give feedback.
-
Given our recent conversations offline, I have been giving some more thought about this. As for the other rules, we want a similar syntax (see here): First of all, we need to define what a range is.
For a
and so on. The Range class from ApacheCommons is a good inspiration for this: https://commons.apache.org/proper/commons-lang/apidocs/org/apache/commons/lang3/Range.html The table above assumes that a fact is an individual value, but we could also have the fact being:
I think as a first phase, we can start with a simpler version of the RangeRule and then build from that. |
Beta Was this translation helpful? Give feedback.
-
Expected Behaviour
Range Validation: The RangeRule class will be specifically designed for validating whether a given fact falls within a specified numeric range with different inclusivity options. It's well-suited for scenarios where we have predefined expectations about the valid range of values for a particular fact.
Actual Behaviour
Currently Range Rule is not supported.
Beta Was this translation helpful? Give feedback.
All reactions