{"record":{"id":"b83b5ccbd24db51d","repo":"flowable/flowable-engine","slug":"form-engine-is-not-initialized-b83b5c","errorCode":null,"errorMessage":"Form engine is not initialized","messagePattern":"Form engine is not initialized","errorType":"validation","errorClass":"FlowableIllegalStateException","httpStatus":null,"severity":"error","filePath":"modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/cmd/AbstractNeedsPlanItemInstanceCmd.java","lineNumber":76,"sourceCode":"        this.transientVariables = transientVariables;\n    }\n\n    @Override\n    public Void execute(CommandContext commandContext) {\n        if (planItemInstanceId == null) {\n            throw new FlowableIllegalArgumentException(\"Plan item instance id is null\");\n        }\n\n        CmmnEngineConfiguration cmmnEngineConfiguration = CommandContextUtil.getCmmnEngineConfiguration(commandContext);\n        PlanItemInstanceEntity planItemInstanceEntity = cmmnEngineConfiguration.getPlanItemInstanceEntityManager().findById(planItemInstanceId);\n        if (planItemInstanceEntity == null) {\n            throw new FlowableObjectNotFoundException(\"Cannot find plan item instance for id \" + planItemInstanceId, PlanItemInstanceEntity.class);\n        }\n\n        if (formInfo != null) {\n            FormService formService = CommandContextUtil.getFormService(commandContext);\n            if (formService == null) {\n                throw new FlowableIllegalStateException(\"Form engine is not initialized\");\n            }\n\n            Map<String, Object> variablesFromFormSubmission = formService.getVariablesFromFormSubmission(planItemInstanceEntity.getPlanItemDefinitionId(), \n                    planItemInstanceEntity.getPlanItemDefinitionType(), planItemInstanceEntity.getCaseInstanceId(), planItemInstanceEntity.getCaseDefinitionId(), \n                    ScopeTypes.CMMN, formInfo, formVariables, formOutcome);\n\n            FormFieldHandler formFieldHandler = cmmnEngineConfiguration.getFormFieldHandler();\n            formFieldHandler.handleFormFieldsOnSubmit(formInfo, null, null, planItemInstanceEntity.getCaseInstanceId(), ScopeTypes.CMMN, variablesFromFormSubmission,\n                    planItemInstanceEntity.getTenantId());\n\n            planItemInstanceEntity.setVariables(variablesFromFormSubmission);\n        }\n\n        if (variables != null) {\n            planItemInstanceEntity.setVariables(variables);\n        }\n\n        if (localVariables != null) {","sourceCodeStart":58,"sourceCodeEnd":94,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/cmd/AbstractNeedsPlanItemInstanceCmd.java#L58-L94","documentation":"FlowableIllegalStateException thrown when a form-containing plan item command (formInfo != null) needs the FormService but CommandContextUtil.getFormService returns null in the CMMN command context. It signals the form engine was not wired into the CMMN engine configuration, so form variable processing cannot proceed.","triggerScenarios":"Calling completePlanItemPlanForm/completePlanItemStandaloneForm with a non-null FormInfo while the FlowableFormApi/form engine is not on the classpath or not registered in the engine configuration (formService not initialized).","commonSituations":"Deploying only the CMMN engine (e.g. flowable-cmmn-engine without flowable-form-engine / Spring integration) but submitting plan forms; custom engine configuration that omitted the form service configuration; upgrading Flowable versions where form engine auto-configuration changed.","solutions":["Add the form engine dependency and initialize it (use flowable-spring-boot-starter-process/cmmn with form support, or explicitly build the FormEngine and register it)","Use CmmnEngineConfiguration's formServiceConfiguration/CommandContextUtil to ensure formService is set before running form commands","If you do not need form handling, pass formInfo = null instead of an empty FormInfo","Check your engine configuration class for a custom buildCmmnEngine that skips form engine initialization"],"exampleFix":"// before\nCmmnEngine cmmnEngine = new StandaloneCmmnEngineConfiguration().buildCmmnEngine(); // no form engine configured\ncmmnTaskService.completePlanItemPlanForm(planItemInstanceId, caseInstanceId, formInfo, variables, null); // throws\n// after\nCmmnEngineConfiguration cfg = new StandaloneCmmnEngineConfiguration();\ncfg.setFormResourceLocator(...); // ensure form engine is part of the setup / use FlowableCmmnEngine auto-configuration with form engine on classpath\nCmmnEngine cmmnEngine = cfg.buildCmmnEngine();\ncmmnTaskService.completePlanItemPlanForm(planItemInstanceId, caseInstanceId, formInfo, variables, null);","handlingStrategy":"fallback","validationCode":"// ensure at startup: if (CommandContextUtil.getFormService(commandContext) == null && formsUsed) throw new IllegalStateException(\"Form engine not configured\");","typeGuard":null,"tryCatchPattern":"try { cmmnTaskService.completePlanItemPlanForm(...); }\ncatch (FlowableIllegalStateException e) { log.error(\"Form engine missing: add flowable-form-engine and register the form service\"); throw e; }","preventionTips":["Include the form engine dependency when using plan item forms","Use Flowable Spring Boot starters which wire the form engine automatically","Audit custom CmmnEngineConfiguration for missing form service setup","Pass formInfo = null when no form handling is needed"],"tags":["flowable","cmmn","form-engine","initialization"],"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"}