Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request for From Clause enhancement #86

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

Request for From Clause enhancement #86

williamwsmith opened this issue Oct 18, 2013 · 0 comments
Assignees
Milestone

Comments

@williamwsmith
Copy link

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
* Added support for js expression in the `from` node addressing issue [noolsjs#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. [noolsjs#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 mentioned this issue Nov 8, 2013
doug-martin added a commit to doug-martin/nools that referenced this issue Nov 8, 2013
* Added support for js expression in the `from` node addressing issue [noolsjs#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. [noolsjs#85](noolsjs#85)
* Fixed issue with `from` node where an undefined property would be tested. [noolsjs#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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants