{"record":{"id":"d55b84eb691e027f","repo":"flowable/flowable-engine","slug":"form-repository-service-is-not-available","errorCode":null,"errorMessage":"Form repository service is not available","messagePattern":"Form repository service is not available","errorType":"exception","errorClass":"FlowableException","httpStatus":null,"severity":"error","filePath":"modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/cmd/GetFormDefinitionsForCaseDefinitionCmd.java","lineNumber":67,"sourceCode":"\n    @Override\n    public List<FormDefinition> execute(CommandContext commandContext) {\n        CaseDefinition caseDefinition = CaseDefinitionUtil.getCaseDefinition(caseDefinitionId);\n        \n        if (caseDefinition == null) {\n            throw new FlowableObjectNotFoundException(\"Cannot find case definition for id: \" + caseDefinitionId, CaseDefinition.class);\n        }\n        \n        Case caseModel = CaseDefinitionUtil.getCase(caseDefinitionId);\n\n        if (caseModel == null) {\n            throw new FlowableObjectNotFoundException(\"Cannot find case definition for id: \" + caseDefinitionId, Case.class);\n        }\n\n        formRepositoryService = CommandContextUtil.getFormEngineConfiguration(commandContext).getFormRepositoryService();\n\n        if (formRepositoryService == null) {\n            throw new FlowableException(\"Form repository service is not available\");\n        }\n\n        List<FormDefinition> formDefinitions = getFormDefinitionsFromModel(caseModel, caseDefinition);\n\n        return formDefinitions;\n    }\n\n    protected List<FormDefinition> getFormDefinitionsFromModel(Case caseModel, CaseDefinition caseDefinition) {\n        Set<String> formKeys = new HashSet<>();\n        List<FormDefinition> formDefinitions = new ArrayList<>();\n\n        // for all user tasks\n        List<HumanTask> humanTasks = caseModel.getPlanModel().findPlanItemDefinitionsOfType(HumanTask.class, true);\n        \n        for (HumanTask humanTask : humanTasks) {\n            if (StringUtils.isNotEmpty(humanTask.getFormKey())) {\n                formKeys.add(humanTask.getFormKey());\n            }","sourceCodeStart":49,"sourceCodeEnd":85,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/cmd/GetFormDefinitionsForCaseDefinitionCmd.java#L49-L85","documentation":"The command resolves the form repository service from the form engine configuration to query form definitions. When the form engine is not configured (no form engine configuration / repository service on the classpath or not initialized) it throws a plain FlowableException. This is an environment/configuration error, not a data error.","triggerScenarios":"Running the CMMN engine without the form engine configured: flowable-form-engine not on the classpath, form engine not included in the engine configuration, or a custom configuration omitting the form repository service.","commonSituations":"Standalone CMMN deployment without flowable-form-engine-spring/config dependency; disabling the form engine intentionally then calling form-definition APIs; version mismatch where the form module was not bootstrapped.","solutions":["Add the flowable-form-engine dependency and include FormEngineConfiguration in the engine configuration (e.g. via flowable-spring-boot-starter or process/standalone config with the form resource)","Verify CommandContextUtil.getFormEngineConfiguration is wired in the used context (e.g. app engine with form engine enabled)","If forms are not needed, do not invoke form-definition APIs instead of leaving the engine half-configured"],"exampleFix":"// before\n// engine config without form engine\nCmmnEngineConfiguration cfg = CmmnEngineConfiguration.createStandaloneConfig();\n// after\nCmmnEngineConfiguration cfg = CmmnEngineConfiguration.createStandaloneConfig();\ncfg.setFormEngineConfiguration(new StandaloneFormEngineConfiguration()); // ensure form engine + repository service available\n","handlingStrategy":"validation","validationCode":"try {\n    FormRepositoryService frs = ProcessEngineConfigurationProvider.get().getFormEngineConfiguration().getFormRepositoryService();\n    boolean available = frs != null;\n} catch (Exception e) { boolean available = false; }","typeGuard":"boolean formEngineAvailable = formEngineConfiguration != null && formEngineConfiguration.getFormRepositoryService() != null;","tryCatchPattern":"try { return getFormDefinitionsForCaseDefinition(id); } catch (FlowableException e) { if (e.getMessage().contains(\"Form repository service\")) { log.error(\"Form engine not configured\"); return Collections.emptyList(); } throw e; }","preventionTips":["Include the flowable-form-engine dependency and register FormEngineConfiguration in your engine setup","Use starters (flowable-spring-boot-starter-process/cmmn) that auto-configure the form engine","If forms are unused, avoid form-definition APIs rather than running a half-configured engine"],"tags":["configuration","form-engine","missing-dependency","cmmn"],"backgroundTag":"missing-dependency","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}