Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Compound NOT clause when multiple facts should not exist #85

Closed
williamwsmith opened this Issue · 0 comments

2 participants

@williamwsmith

I would like to have an OR constraint contain multiple NOT conditions. Basically WHEN any of 2 facts do not exist in working memory THEN. There is the issue that Or only takes 2 conditions, but, that aside, how is this typically done? Being new to rules I may be completely missing the obvious. I understand I could make more rules to get the OR behavior, but, then I have to replicate the THEN logic, or, I have to have some flag/book keeping fact.

Something like below, when there is not a String OR a Count, AND there is a Date.

rule OrNotRule {
    when {
        or (
                  not(s : String),
                  not(count : Count)
            );
            day:Date;
    }
    then {
        //do something
    }
}
@doug-martin doug-martin was assigned
@doug-martin doug-martin referenced this issue from a commit in doug-martin/nools
@doug-martin doug-martin v0.2.1
* Added support for js expression in the `from` node addressing issue [#86](C2FO#86)
* Enhanced `JoinReferenceNode` performance in the default assert case where there are no `references` to left or right context.
* Added ability to use `or` and `not` in tandem to check for the non-existence of multiple facts. [#85](C2FO#85)
* You can now define a custom resolution strategy.
* Compiling nools files now supports the from modifier.
* Documentation updates
   * Updates about from node support with js values.
   * New documentation about using `or` and `not` constratints together.
   * Updated `or` documentation to include a three constraint example.
a6475b3
@doug-martin doug-martin referenced this issue
Merged

v0.2.1 #90

@doug-martin doug-martin referenced this issue from a commit in doug-martin/nools
@doug-martin doug-martin v0.2.1
* Added support for js expression in the `from` node addressing issue [#86](C2FO#86)
* Enhanced `JoinReferenceNode` performance in the default assert case where there are no `references` to left or right context.
* Added ability to use `or` and `not` in tandem to check for the non-existence of multiple facts. [#85](C2FO#85)
* Fixed issue with `from` node where an undefined property would be tested. [#89](C2FO#89)
* You can now define a custom resolution strategy.
* Compiling nools files now supports the from modifier.
* Documentation updates
   * Updates about from node support with js values.
   * New documentation about using `or` and `not` constratints together.
   * Updated `or` documentation to include a three constraint example.
86eea5e
@doug-martin doug-martin closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.