{"record":{"id":"aff40263977c530e","repo":"flowable/flowable-engine","slug":"dmn-repository-service-is-not-available-aff402","errorCode":null,"errorMessage":"DMN repository service is not available","messagePattern":"DMN repository service is not available","errorType":"exception","errorClass":"FlowableException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine/src/main/java/org/flowable/engine/impl/cmd/GetDecisionsForProcessDefinitionCmd.java","lineNumber":65,"sourceCode":"        this.processDefinitionId = processDefinitionId;\n    }\n\n    @Override\n    public List<DmnDecision> execute(CommandContext commandContext) {\n        ProcessDefinition processDefinition = ProcessDefinitionUtil.getProcessDefinition(processDefinitionId);\n\n        if (processDefinition == null) {\n            throw new FlowableObjectNotFoundException(\"Cannot find process definition for id: \" + processDefinitionId, ProcessDefinition.class);\n        }\n\n        BpmnModel bpmnModel = ProcessDefinitionUtil.getBpmnModel(processDefinitionId);\n\n        if (bpmnModel == null) {\n            throw new FlowableObjectNotFoundException(\"Cannot find bpmn model for process definition id: \" + processDefinitionId, BpmnModel.class);\n        }\n\n        if (CommandContextUtil.getDmnRepositoryService() == null) {\n            throw new FlowableException(\"DMN repository service is not available\");\n        }\n\n        dmnRepositoryService = CommandContextUtil.getDmnRepositoryService();\n        List<DmnDecision> decisions = getDecisionsFromModel(bpmnModel, processDefinition);\n\n        return decisions;\n    }\n\n    protected List<DmnDecision> getDecisionsFromModel(BpmnModel bpmnModel, ProcessDefinition processDefinition) {\n        Set<String> decisionKeys = new HashSet<>();\n        List<DmnDecision> decisions = new ArrayList<>();\n        List<ServiceTask> serviceTasks = bpmnModel.getMainProcess().findFlowElementsOfType(ServiceTask.class, true);\n\n        for (ServiceTask serviceTask : serviceTasks) {\n            if (\"dmn\".equals(serviceTask.getType())) {\n                if (serviceTask.getFieldExtensions() != null && serviceTask.getFieldExtensions().size() > 0) {\n                    for (FieldExtension fieldExtension : serviceTask.getFieldExtensions()) {\n                        if (\"decisionTableReferenceKey\".equals(fieldExtension.getFieldName())) {","sourceCodeStart":47,"sourceCodeEnd":83,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine/src/main/java/org/flowable/engine/impl/cmd/GetDecisionsForProcessDefinitionCmd.java#L47-L83","documentation":"FlowableException thrown when CommandContextUtil.getDmnRepositoryService() returns null inside GetDecisionsForProcessDefinitionCmd.execute. It means the process engine has no DMN engine/repository service wired in, so decision information cannot be fetched even though the BPMN model exists. This is an engine configuration problem, not a data problem.","triggerScenarios":"Calling getDecisionsForProcessDefinition(...) on an engine configured without a DMN repository service (no DMN engine dependency, DMN engine not started, or a custom ProcessEngineConfiguration that never sets dmnRepositoryService).","commonSituations":"Application includes flowable-engine but not the DMN engine dependency on the classpath; embedded engine built programmatically without starting the DMN engine; Spring Boot app with dmn support excluded; upgrade where the DMN engine config was dropped.","solutions":["Add the flowable-dmn-engine (or flowable-dmn-spring-configurer / spring-boot-starter) dependency and ensure the DMN engine is initialized with the process engine.","Check your ProcessEngineConfiguration / processEngineConfiguration.xml so the DMN repository service is registered and accessible via CommandContextUtil.","If DMN is not needed, do not call getDecisionsForProcessDefinition; guard the call on whether DMN support is configured.","Catch FlowableException and degrade gracefully (return empty decision list) when DMN is optional in your environment."],"exampleFix":"// before\nEngineConfiguration cfg = new StandaloneProcessEngineConfiguration(); // no DMN wiring\n// after\nEngineConfiguration cfg = new StandaloneProcessEngineConfiguration()\n    .setEnableDatabaseEventLogging(false);\nDmnEngine dmnEngine = DmnEngineConfiguration\n    .createStandaloneDmnEngineConfiguration().buildDmnEngine();\ncfg.setDmnEngineRepositoryService(dmnEngine.getDmnRepositoryService());","handlingStrategy":"validation","validationCode":"// fail fast at startup if DMN support is required\nDmnRepositoryService drs = engineConfig.getDmnEngineRepositoryService();\nif (drs == null) throw new IllegalStateException(\"DMN engine not configured\");","typeGuard":"boolean isDmnAvailable(ProcessEngine engine) {\n    try {\n        return engine.getRuntimeService() != null\n            && engine.getConfig().getDmnEngineRepositoryService() != null; // adjust to your accessor\n    } catch (Exception e) {\n        return false;\n    }\n}","tryCatchPattern":"try {\n    return repositoryService.getDecisionsForProcessDefinition(id);\n} catch (FlowableException e) {\n    if (e.getMessage().contains(\"DMN repository service is not available\")) {\n        log.error(\"DMN support not configured\");\n        return Collections.emptyList();\n    }\n    throw e;\n}","preventionTips":["Add the flowable-dmn-engine dependency whenever decision tables are referenced from BPMN.","Assert DMN engine availability in a startup health check.","Keep process engine and DMN engine configuration in one place so they are initialized together.","Feature-flag decision queries and test with DMN disabled to catch config drift."],"tags":["flowable","dmn","configuration","missing-dependency"],"backgroundTag":"missing-dependency","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}