Skip to content

Instantly share code, notes, and snippets.



Last active Aug 18, 2017
What would you like to do?
drools dmn execution
KieServices kieServices = KieServices.Factory.get();
KieContainer kieContainer = kieServices.getKieClasspathContainer();
DMNRuntime dmnRuntime = kieContainer.newKieSession().getKieRuntime( DMNRuntime.class );
DMNModel dmnModel = dmnRuntime.getModel("", "driving-eligibility");
DMNContext dmnContext = dmnRuntime.newContext();
Map<String, Object> person = new HashMap<>();
person.put("name", "Donato");
person.put("age", 17);
person.put("country", "italy");
dmnContext.set("Person", person);
DMNResult dmnResult = dmnRuntime.evaluateAll(dmnModel, dmnContext);
for (DMNDecisionResult dr : dmnResult.getDecisionResults()) {
System.out.println("Decision '" + dr.getDecisionName() + "' : " + dr.getResult());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.