Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Request for From Clause enhancement #86

Closed
williamwsmith opened this Issue · 0 comments

2 participants

@williamwsmith

I noticed you just added "from". This is great step forward toward pulling in non-working memory data into the rules. In looking through some DRL samples I saw these snippets below. "from" looks like a great way to initialize/bootstrap some data. Allowing constants, and arrays could be very handy. Allowing me to pump in data from a javascript style iterator I added to the {scope} would let me put some of my database data sets right into the constraints and get a cross-product going.

Thanks again for all the great work on this, we will be using it on our next project starting in 2014. Wish I could contribute, but, for me at this stage the learning curve on the engine itself is too steep.

//DROOLs DRL

rule "Create Gold" when
Init()
not Gold() // here to break sharing, to force new random numbers, also retriggers on retraction
$row : Integer() from randomInteger.nextInt( 4 )
$col : Integer() from randomInteger.nextInt( 4 )
then
Gold gold = new Gold($row, $col);
insert( gold );
end

*/

/*
rule "Create Cells" when
Init()
$i : Integer() from [0, 1, 2, 3, 4]
$j : Integer() from [0, 1, 2, 3, 4]
$c : Cell() from new Cell($i, $j)
then
insert( $c );
end

@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 was assigned
@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.