Skip to content

Instantly share code, notes, and snippets.

@evacchi
Created July 26, 2018 09:02
Show Gist options
  • Select an option

  • Save evacchi/a92278e9c185a455093d719dd368ac4e to your computer and use it in GitHub Desktop.

Select an option

Save evacchi/a92278e9c185a455093d719dd368ac4e to your computer and use it in GitHub Desktop.
package io.evacchi.github;
import io.github.evacchi.*;
dialect "mvel"
rule "last0"
when
$l : Last(list.tail == null)
then
System.out.println("last is " + $l.getList().getHead());
end
rule "last1"
when
$matched: Last($value: value, $list: list, list.tail != null)
then
last = new Last($value, $list.getTail());
insert(last)
System.out.println("insert: "+last);
end
rule "query_last"
when
Query($L: query)
then
insert($L)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment