{"record":{"id":"3fa8cd6e1e7bdb86","repo":"flowable/flowable-engine","slug":"form-repository-service-is-not-available-3fa8cd","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-engine/src/main/java/org/flowable/engine/impl/cmd/GetFormDefinitionsForProcessDefinitionCmd.java","lineNumber":66,"sourceCode":"        this.processDefinitionId = processDefinitionId;\n    }\n\n    @Override\n    public List<FormDefinition> 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.getFormRepositoryService() == null) {\n            throw new FlowableException(\"Form repository service is not available\");\n        }\n\n        formRepositoryService = CommandContextUtil.getFormRepositoryService();\n        List<FormDefinition> formDefinitions = getFormDefinitionsFromModel(bpmnModel, processDefinition);\n\n        return formDefinitions;\n    }\n\n    protected List<FormDefinition> getFormDefinitionsFromModel(BpmnModel bpmnModel, ProcessDefinition processDefinition) {\n        Set<String> formKeys = new HashSet<>();\n        List<FormDefinition> formDefinitions = new ArrayList<>();\n\n        // for all start events\n        List<StartEvent> startEvents = bpmnModel.getMainProcess().findFlowElementsOfType(StartEvent.class, true);\n\n        for (StartEvent startEvent : startEvents) {\n            if (StringUtils.isNotEmpty(startEvent.getFormKey())) {\n                formKeys.add(startEvent.getFormKey());","sourceCodeStart":48,"sourceCodeEnd":84,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine/src/main/java/org/flowable/engine/impl/cmd/GetFormDefinitionsForProcessDefinitionCmd.java#L48-L84","documentation":"GetFormDefinitionsForProcessDefinitionCmd requires the Flowable form repository service to be present in the command context. The engine throws FlowableException when CommandContextUtil.getFormRepositoryService() returns null, i.e. the process engine was configured without the form engine integrated. Form definitions are stored by the form engine module, so without it the command cannot proceed.","triggerScenarios":"Calling getFormDefinitionsForProcessDefinition (or the underlying command) on a plain flowable-engine ProcessEngine that was built without the flowable-form-engine-config module / FormEngineConfiguration wired in; querying form definitions in a standalone engine setup where only the BPMN engine is deployed.","commonSituations":"Adding the form REST/UI endpoints without adding the form engine dependency; engine configured programmatically without the form resource deployer; upgrade where the form module was removed from the classpath but callers still query form definitions.","solutions":["Add the flowable-form-engine dependency and configure the process engine through a combined configuration (e.g. ProcessEngineConfigurationConfigurer wiring FormEngineConfiguration, or use flowable-spring-boot-starter-process + form starter).","Verify at runtime that the form repository service is available before invoking the command, and fail gracefully otherwise.","If forms are not used in this deployment, stop calling form-definition lookups for these process definitions.","Check the classpath/build for the form engine JAR and that the engine's config registers it."],"exampleFix":"// before (plain engine, no form engine)\nList<FormDefinition> forms = formRepositoryService.getFormDefinitionsForProcessDefinition(pdId);\n// after: wire the form engine\nengineConfig.setEnableFormEngine(true); // or add flowable-form-engine-spring-config and its deployer\nif (formRepositoryService == null) {\n    throw new IllegalStateException(\"Form engine not configured; add flowable-form-engine\");\n}","handlingStrategy":"validation","validationCode":"if (formRepositoryService == null) {\n    throw new IllegalStateException(\"Form engine not configured; add flowable-form-engine to the engine configuration\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    return formRepositoryService.getFormDefinitionsForProcessDefinition(processDefinitionId);\n} catch (FlowableException e) {\n    log.error(\"Form engine unavailable: {}\", e.getMessage());\n    return Collections.emptyList();\n}","preventionTips":["Include the flowable-form-engine dependency and wire FormEngineConfiguration at startup","Smoke-test form endpoints right after engine boot so misconfiguration surfaces early","Feature-toggle form lookups when the deployment intentionally excludes the form engine"],"tags":["flowable","form-engine","missing-dependency","configuration"],"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"}