Skip to content

Compound NOT clause when multiple facts should not exist #85

@williamwsmith

Description

@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
    }
}

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions