Skip to content

Instantly share code, notes, and snippets.

@aalmiray
Created April 26, 2010 13:51
Show Gist options
  • Save aalmiray/379347 to your computer and use it in GitHub Desktop.
Save aalmiray/379347 to your computer and use it in GitHub Desktop.
public class RunScript {
public static void main(String[] args) {
final Binding binding = new Binding();
GroovyShell shell = new GroovyShell(binding);
shell.evaluate(new File("GroovyOrder.groovy"));
Object result = shell.evaluate(new File("order.dsl"));
final Object result = dsl.call();
List<Order> r = (List<Order>) result;
int val = 0;
for(Order x : r) {
val += (Integer)(x.getValue());
}
System.out.println(val);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment