Request for From Clause enhancement #86

Closed
williamwsmith opened this Issue Oct 18, 2013 · 0 comments

Comments

Projects
None yet
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 added a commit to doug-martin/nools that referenced this issue Nov 8, 2013

v0.2.1
* Added support for js expression in the `from` node addressing issue [#86](noolsjs#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](noolsjs#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.

@doug-martin doug-martin referenced this issue Nov 8, 2013

Merged

v0.2.1 #90

doug-martin added a commit to doug-martin/nools that referenced this issue Nov 8, 2013

v0.2.1
* Added support for js expression in the `from` node addressing issue [#86](noolsjs#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](noolsjs#85)
* Fixed issue with `from` node where an undefined property would be tested. [#89](noolsjs#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.

@ghost ghost assigned doug-martin Nov 8, 2013

@doug-martin doug-martin closed this Nov 8, 2013

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