-
Notifications
You must be signed in to change notification settings - Fork 179
Description
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