flowable/flowable-engine · error · FlowableIllegalStateException

Form engine is not initialized

Error message

Form engine is not initialized

What it means

When a case task uses a form to provide its input variables, execute() fetches the FormService from the command context. If the form engine module is not deployed/configured in the engine configuration, getFormService returns null and this error is thrown. The case task cannot resolve form-submitted variables without the form engine.

Source

Thrown at modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/behavior/impl/CaseTaskActivityBehavior.java:108

        caseInstanceBuilder.parentId(planItemInstanceEntity.getCaseInstanceId());

        if (fallbackToDefaultTenant != null && fallbackToDefaultTenant) {
            caseInstanceBuilder.fallbackToDefaultTenant();
        }

        Map<String, Object> finalVariableMap = new HashMap<>();
        handleInParameters(planItemInstanceEntity, cmmnEngineConfiguration, finalVariableMap, cmmnEngineConfiguration.getExpressionManager());

        // Needed for the form field handler later
        Map<String, Object> variablesFromFormSubmission = null;

        if (variableInfo != null) {

            if (variableInfo.formInfo != null) {
                FormService formService = CommandContextUtil.getFormService(commandContext);
                if (formService == null) {
                    throw new FlowableIllegalStateException("Form engine is not initialized");
                }

                variablesFromFormSubmission = formService.getVariablesFromFormSubmission(planItemInstanceEntity.getPlanItemDefinitionId(), "caseTask", 
                        planItemInstanceEntity.getCaseInstanceId(), planItemInstanceEntity.getCaseDefinitionId(), ScopeTypes.CMMN, 
                        variableInfo.formInfo, variableInfo.formVariables, variableInfo.formOutcome);

                finalVariableMap.putAll(variablesFromFormSubmission);
            }

            if (variableInfo.variables != null && !variableInfo.variables.isEmpty()) {
                finalVariableMap.putAll(variableInfo.variables);
            }
        }

        caseInstanceBuilder.businessKey(getBusinessKey(cmmnEngineConfiguration, planItemInstanceEntity, caseTask));
        caseInstanceBuilder.variables(finalVariableMap);

        if (sameDeployment) {

View on GitHub (pinned to d6d39ce1c6)

Solutions

  1. Add the flowable-form-engine dependency and deploy/register the form engine so FormService is available.
  2. In Spring Boot, include the form engine in the process/cmmn engine configuration (Flowable 6 app engines set this up automatically).
  3. If no form is needed, remove the form reference/formKey from the case task so no formInfo is created.
  4. Replace form-based variable resolution with explicit in-parameter mappings on the case task.

Example fix

// before
CmmnEngineConfiguration cfg = CmmnEngineConfiguration
    .createStandaloneInMemCmmnEngineConfiguration(); // no form engine
// after
cfg.setFormEngineConfiguration(formEngineConfiguration); // deploy form engine
// or use org.flowable.app engine which wires form + cmmn together
Defensive patterns

Strategy: fallback

Validate before calling

boolean formEngineAvailable = cmmnEngineConfiguration.getFormEngineConfiguration() != null;
if (!formEngineAvailable) throw new IllegalStateException("form engine required for case tasks with forms");

Try / catch

try {
    cmmnRuntimeService.startCaseInstance(builder);
} catch (FlowableIllegalStateException e) {
    if (e.getMessage().equals("Form engine is not initialized")) {
        // fall back to explicit variable mappings instead of forms
    }
}

Prevention

When it happens

Trigger: Executing a case task with a formInfo (form key/form definition) whose variables come from a form submission while the flowable-form-engine module is absent from the CmmnEngineConfiguration (no form engine deployed in the app).

Common situations: Standalone CMMN engine setup without flowable-form-engine on the classpath; Spring Boot app without the form engine auto-configuration; embedded engine built with an engine configuration lacking the form service.

Understand the failure class

Background: "not installed", "pip install", "required for": how missing-dependency errors surface across open-source libraries — this error's family across 34 libraries.

Related errors


AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11). Data as JSON: /api/errors/583cf9a9575f7047. Report an issue: GitHub.