{"record":{"id":"68716602fecc1a5f","repo":"flowable/flowable-engine","slug":"executionid-is-null-687166","errorCode":null,"errorMessage":"executionId is null","messagePattern":"executionId is null","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine/src/main/java/org/flowable/engine/impl/cmd/HandleCaseTaskErrorCmd.java","lineNumber":44,"sourceCode":"\n/**\n * Handles an uncaught {@link BusinessError} from a child CMMN case instance\n * by propagating it as a BPMN error on the parent CaseTask execution.\n * The full BusinessError is passed through so that error data (code, message,\n * additional data) is preserved for boundary error event variable mapping.\n *\n * @author Joram Barrez\n */\npublic class HandleCaseTaskErrorCmd implements Command<Void>, Serializable {\n\n    private static final long serialVersionUID = 1L;\n\n    protected String executionId;\n    protected BusinessError error;\n\n    public HandleCaseTaskErrorCmd(String executionId, BusinessError error) {\n        if (executionId == null) {\n            throw new FlowableIllegalArgumentException(\"executionId is null\");\n        }\n        if (error == null) {\n            throw new FlowableIllegalArgumentException(\"error is null\");\n        }\n        this.executionId = executionId;\n        this.error = error;\n    }\n\n    @Override\n    public Void execute(CommandContext commandContext) {\n        ProcessEngineConfigurationImpl processEngineConfiguration = CommandContextUtil.getProcessEngineConfiguration(commandContext);\n        ExecutionEntity execution = (ExecutionEntity) processEngineConfiguration.getExecutionEntityManager().findById(executionId);\n        if (execution == null) {\n            throw new FlowableException(\"No execution could be found for id \" + executionId);\n        }\n\n        ErrorPropagation.propagateError(error, execution);\n        return null;","sourceCodeStart":26,"sourceCodeEnd":62,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine/src/main/java/org/flowable/engine/impl/cmd/HandleCaseTaskErrorCmd.java#L26-L62","documentation":"The HandleCaseTaskErrorCmd constructor validates its arguments and throws FlowableIllegalArgumentException(\"executionId is null\") when the execution id is null. This command propagates a business error to a CMMN case task's execution, which is meaningless without an execution reference.","triggerScenarios":"Constructing new HandleCaseTaskErrorCmd(null, error) — e.g. when the executionId was resolved from a task/plan item that returned null, or a caller passes an unset variable into the command.","commonSituations":"Error-handling pipelines where the execution id is looked up dynamically and the lookup failed; wiring the command from a message/DTO whose executionId field was absent; unit tests forgetting to set the id.","solutions":["Pass a valid, non-null executionId when constructing HandleCaseTaskErrorCmd.","Validate/resolve the executionId from the calling context (task -> execution) before building the command.","Fix the upstream lookup that produced null (e.g. executionEntityManager lookup or task.getExecutionId()).","Catch FlowableIllegalArgumentException at the service boundary and surface a validation error."],"exampleFix":"// before\nmanagementService.executeCommand(new HandleCaseTaskErrorCmd(taskInfo.getExecutionId(), error));\n// after\nif (taskInfo.getExecutionId() == null) {\n    throw new IllegalStateException(\"Cannot propagate error: executionId missing\");\n}\nmanagementService.executeCommand(new HandleCaseTaskErrorCmd(taskInfo.getExecutionId(), error));","handlingStrategy":"validation","validationCode":"if (executionId == null || executionId.isEmpty()) {\n    throw new IllegalStateException(\"Cannot propagate case task error: executionId missing\");\n}","typeGuard":"boolean hasExecutionId(String id) { return id != null && !id.isEmpty(); }","tryCatchPattern":"try {\n    managementService.executeCommand(new HandleCaseTaskErrorCmd(executionId, error));\n} catch (FlowableIllegalArgumentException e) {\n    throw new BadRequestException(\"Invalid HandleCaseTaskErrorCmd arguments: \" + e.getMessage(), e);\n}","preventionTips":["Resolve executionId from the task/plan item immediately before constructing the command","Validate command inputs in a thin wrapper around managementService.executeCommand","Log the source of null ids to find the broken lookup path"],"tags":["flowable","cmmn","null-argument","error-propagation"],"backgroundTag":"null-argument","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"}