class NewDMNRuntimeCommand implements ExecutableCommand<DMNRuntime> {

    @Override
    public DMNRuntime execute(Context context) {
        RegistryContext registryContext = (RegistryContext) context;
        KieContainer kieContainer = registryContext.lookup(KieContainer.class);
        if (kieContainer == null) {
            throw new IllegalStateException("There is no existing KieContainer assigned to the Registry");
        }
        DMNRuntime dmnRuntime = KieRuntimeFactory.of(kieContainer.getKieBase()).get(DMNRuntime.class);

        registryContext.register(DMNRuntime.class, dmnRuntime);
        return dmnRuntime;
    }

}