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

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

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

@ghost ghost assigned doug-martin Jul 30, 2013

@goodwithgit

This comment has been minimized.

Show comment
Hide comment

+1

@doug-martin

This comment has been minimized.

Show comment
Hide comment
@doug-martin

doug-martin Sep 5, 2013

Contributor

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.

Contributor

doug-martin commented Sep 5, 2013

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 added a commit to doug-martin/nools that referenced this issue Sep 24, 2013

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`.

@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