{"record":{"id":"95427cfdf1d66e7f","repo":"flowable/flowable-engine","slug":"form-engine-is-not-initialized-95427c","errorCode":null,"errorMessage":"Form engine is not initialized","messagePattern":"Form engine is not initialized","errorType":"exception","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine/src/main/java/org/flowable/engine/impl/cmd/GetStartFormModelCmd.java","lineNumber":55,"sourceCode":" */\npublic class GetStartFormModelCmd implements Command<FormInfo>, Serializable {\n\n    private static final long serialVersionUID = 1L;\n\n    protected String processDefinitionId;\n    protected String processInstanceId;\n\n    public GetStartFormModelCmd(String processDefinitionId, String processInstanceId) {\n        this.processDefinitionId = processDefinitionId;\n        this.processInstanceId = processInstanceId;\n    }\n\n    @Override\n    public FormInfo execute(CommandContext commandContext) {\n        ProcessEngineConfigurationImpl processEngineConfiguration = CommandContextUtil.getProcessEngineConfiguration(commandContext);\n        FormService formService = CommandContextUtil.getFormService(commandContext);\n        if (formService == null) {\n            throw new FlowableIllegalArgumentException(\"Form engine is not initialized\");\n        }\n\n        FormInfo formInfo = null;\n        ProcessDefinition processDefinition = ProcessDefinitionUtil.getProcessDefinition(processDefinitionId);\n        BpmnModel bpmnModel = ProcessDefinitionUtil.getBpmnModel(processDefinitionId);\n        Process process = bpmnModel.getProcessById(processDefinition.getKey());\n        FlowElement startElement = process.getInitialFlowElement();\n        if (startElement instanceof StartEvent startEvent) {\n            if (StringUtils.isNotEmpty(startEvent.getFormKey())) {\n                Deployment deployment = CommandContextUtil.getDeploymentEntityManager(commandContext).findById(processDefinition.getDeploymentId());\n                formInfo = formService.getFormInstanceModelByKeyAndParentDeploymentId(startEvent.getFormKey(), deployment.getParentDeploymentId(), \n                                null, processInstanceId, null, processDefinition.getTenantId(), processEngineConfiguration.isFallbackToDefaultTenant());\n            }\n        }\n\n        // If form does not exists, we don't want to leak out this info to just anyone\n        if (formInfo == null) {\n            throw new FlowableObjectNotFoundException(\"Form model for process definition \" + processDefinitionId + \" cannot be found\");","sourceCodeStart":37,"sourceCodeEnd":73,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine/src/main/java/org/flowable/engine/impl/cmd/GetStartFormModelCmd.java#L37-L73","documentation":"GetStartFormModelCmd requires the Flowable form engine (the flowable-form-engine module and its formService) to be present in the engine configuration. When CommandContextUtil.getFormService returns null the command throws FlowableIllegalArgumentException('Form engine is not initialized'). It signals the form-engine module was never plugged into the process engine configuration.","triggerScenarios":"Calling FormService.getStartFormModel / RuntimeService startForm APIs when the flowable-form-engine dependency (or its EngineConfigurator) is absent, so ProcessEngineConfigurationImpl.formService is null.","commonSituations":"Using flowable-engine without flowable-form-engine on the classpath; Spring Boot app that excludes FlowableFormAutoConfiguration; a custom configuration that removes the form engine configurator; fat-jar builds that strip the optional form module.","solutions":["Add the flowable-form-engine dependency (org.flowable:flowable-form-engine) so its EngineConfigurator registers the formService","For Spring Boot ensure the flowable-spring-boot-starter (which includes form support) is used, or re-enable form auto-configuration","Check configuration.isFormEngineEnabled / configurators at startup and confirm getFormService() is non-null before calling form APIs","If forms are not needed at all, avoid the getStartFormModel API family and use legacy getStartFormData"],"exampleFix":"// before\n<dependency> only flowable-engine -> formService.getStartFormModel(pdId) throws\n// after\n<dependency>\n  <groupId>org.flowable</groupId>\n  <artifactId>flowable-form-engine</artifactId>\n</dependency>","handlingStrategy":"validation","validationCode":"if (processEngineConfiguration.getFormService() == null) {\n    throw new IllegalStateException(\"flowable-form-engine is not on the classpath / not configured\");\n}","typeGuard":"boolean formEngineReady(ProcessEngine engine) {\n    return engine != null && engine.getProcessEngineConfiguration().getFormService() != null;\n}","tryCatchPattern":"try {\n    return formService.getStartFormModel(pdId, null);\n} catch (FlowableIllegalArgumentException e) {\n    if (e.getMessage() != null && e.getMessage().contains(\"Form engine is not initialized\")) {\n        throw new IllegalStateException(\"Add org.flowable:flowable-form-engine to the application\", e);\n    }\n    throw e;\n}","preventionTips":["Include flowable-form-engine (or the full flowable-spring-boot-starter) as a compile dependency","Smoke-test at startup that getFormService() is non-null before serving form endpoints","Do not exclude the form auto-configuration unless you truly never call form APIs"],"tags":["flowable","form-engine","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-18T11:17:12.947Z"}