more than two conditions in an or() block #45

Closed
christiaantk opened this Issue Jul 22, 2013 · 2 comments

Projects

None yet

3 participants

@christiaantk

I am looking for a way to have more than two conditions in an or() block.
The following rule will not parse:

rule hello {
when {
or(
a : String a == 'hello',
b : String b == 'hello',
c : String c == 'hello'

);
}
then {
}
}

A possible alternative notation might be something like:

rule hello {
when {
a : String b : String c : String a == 'hello' || b == 'hello' || c == 'hello'
}
then {
}
}

@doug-martin doug-martin was assigned Jul 30, 2013
@doug-martin
C2FO member

You can currently do the following.

rule orRule{

   when {
      s: String s == 'hello' || s == 'world' || s == 'hello world';
   }
   then {
      //...
   }

}

The or is meant to be used with Facts of different types.

@doug-martin doug-martin added a commit to doug-martin/nools that referenced this issue Sep 24, 2013
@doug-martin doug-martin v0.1.13
* Fixed issue #68 where `matchUntilHalt` uses a lot of CPU
* Fixed issue #45, now compiled rules support `or` constraint with more than 2 inner constraints.
* Added new feature to address #76, now you can use `deleteFlows` to dispose all flows, or use `hasFlow` to check if a flow is already registred with `nools`.
4aadfe6
@doug-martin doug-martin referenced this issue Sep 24, 2013
Merged

v0.1.13 #77

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment