{"record":{"id":"a269a1d5962df17f","repo":"flowable/flowable-engine","slug":"forminfo-is-null-a269a1","errorCode":null,"errorMessage":"formInfo is null","messagePattern":"formInfo is null","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine/src/main/java/org/flowable/engine/impl/runtime/ProcessInstanceBuilderImpl.java","lineNumber":240,"sourceCode":"    @Override\n    public ProcessInstanceBuilder startFormVariable(String variableName, Object value) {\n        if (this.startFormVariables == null) {\n            this.startFormVariables = new HashMap<>();\n        }\n        this.startFormVariables.put(variableName, value);\n        return this;\n    }\n\n    @Override\n    public ProcessInstanceBuilder outcome(String outcome) {\n        this.outcome = outcome;\n        return this;\n    }\n\n    @Override\n    public ProcessInstanceBuilder formVariables(Map<String, Object> formVariables, FormInfo formInfo, String formOutcome) {\n        if (formInfo == null) {\n            throw new FlowableIllegalArgumentException(\"formInfo is null\");\n        }\n\n        if (this.extraFormVariables == null) {\n            this.extraFormVariables = new HashMap<>();\n        }\n\n        if (formVariables != null) {\n            this.extraFormVariables.putAll(formVariables);\n        }\n\n        this.extraFormInfo = formInfo;\n        this.extraFormOutcome = formOutcome;\n        return this;\n    }\n\n\n    @Override\n    public ProcessInstanceBuilder fallbackToDefaultTenant() {","sourceCodeStart":222,"sourceCodeEnd":258,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine/src/main/java/org/flowable/engine/impl/runtime/ProcessInstanceBuilderImpl.java#L222-L258","documentation":"ProcessInstanceBuilderImpl.formVariables registers extra form-related variables for a process start. It requires a non-null FormInfo; passing null throws FlowableIllegalArgumentException because form variable resolution (fields, outcome) cannot proceed without it.","triggerScenarios":"Calling processInstanceBuilder.formVariables(map, null, outcome); passing a FormInfo that a lookup (form repository service) returned as null because the form key/model was not found; wiring form metadata conditionally and passing null when absent.","commonSituations":"Start-form integration where the process has no start form defined, so the retrieved FormInfo is null; refactored code that dropped the form lookup; version changes in the form model API (task/process form handling).","solutions":["Only call formVariables when a FormInfo was actually resolved; guard with if (formInfo != null).","If you have plain variables with no form, use processInstanceBuilder.variables(map) instead of formVariables.","Fix the form lookup so it returns a valid FormInfo (check the form definition exists for the process).","Skip form-outcome handling when there is no form."],"exampleFix":"// before\nbuilder.formVariables(vars, formRepositoryService.getFormInfo(...), outcome); // may pass null\n// after\nFormInfo formInfo = formRepositoryService.getFormInfo(...);\nif (formInfo != null) {\n    builder.formVariables(vars, formInfo, outcome);\n} else {\n    builder.variables(vars);\n}","handlingStrategy":"type-guard","validationCode":"if (formInfo == null) {\n    builder.variables(vars); // plain path\n} else {\n    builder.formVariables(vars, formInfo, formOutcome);\n}","typeGuard":"boolean hasForm(FormInfo fi) { return fi != null && fi.getFormKey() != null; }","tryCatchPattern":"try {\n    builder.formVariables(vars, formInfo, outcome);\n} catch (FlowableIllegalArgumentException e) {\n    log.error(\"formVariables rejected: {}\", e.getMessage());\n    throw e;\n}","preventionTips":["Resolve FormInfo via FormRepositoryService and null-check before use.","Fall back to plain variables() when no start form exists.","Handle processes without start forms explicitly in start-form UI flows."],"tags":["java","flowable","process-instance","forms","null-check"],"backgroundTag":"null-argument","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}