{"record":{"id":"b9a3668885b1a494","repo":"flowable/flowable-engine","slug":"executionid-is-null-b9a366","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/GetDataObjectCmd.java","lineNumber":65,"sourceCode":"\n    public GetDataObjectCmd(String executionId, String dataObjectName, boolean isLocal) {\n        this.executionId = executionId;\n        this.dataObjectName = dataObjectName;\n        this.isLocal = isLocal;\n    }\n\n    public GetDataObjectCmd(String executionId, String dataObjectName, boolean isLocal, String locale, boolean withLocalizationFallback) {\n        this.executionId = executionId;\n        this.dataObjectName = dataObjectName;\n        this.isLocal = isLocal;\n        this.locale = locale;\n        this.withLocalizationFallback = withLocalizationFallback;\n    }\n\n    @Override\n    public DataObject execute(CommandContext commandContext) {\n        if (executionId == null) {\n            throw new FlowableIllegalArgumentException(\"executionId is null\");\n        }\n        if (dataObjectName == null) {\n            throw new FlowableIllegalArgumentException(\"dataObjectName is null\");\n        }\n\n        ExecutionEntity execution = CommandContextUtil.getExecutionEntityManager(commandContext).findById(executionId);\n\n        if (execution == null) {\n            throw new FlowableObjectNotFoundException(\"execution \" + executionId + \" doesn't exist\", Execution.class);\n        }\n\n        DataObject dataObject = null;\n\n        VariableInstance variableEntity = null;\n        if (Flowable5Util.isFlowable5ProcessDefinitionId(commandContext, execution.getProcessDefinitionId())) {\n            Flowable5CompatibilityHandler compatibilityHandler = Flowable5Util.getFlowable5CompatibilityHandler();\n            variableEntity = compatibilityHandler.getExecutionVariableInstance(executionId, dataObjectName, isLocal);\n","sourceCodeStart":47,"sourceCodeEnd":83,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine/src/main/java/org/flowable/engine/impl/cmd/GetDataObjectCmd.java#L47-L83","documentation":"GetDataObjectCmd reads a named DataObject for an execution. Its first validation is that executionId must be non-null; a null id throws FlowableIllegalArgumentException before any database lookup. This is an input-validation failure, not a lookup miss.","triggerScenarios":"Calling runtimeService.getDataObject(null, dataObjectName) or getDataObjectLocal with a null execution id; an Execution entity obtained from a query returned and its id was not stored; variables maps built dynamically with missing execution references.","commonSituations":"Asynchronous listeners running after the execution was handled; passing an optional variable that was never initialized; scripting/template expressions evaluating to null.","solutions":["Guarantee a non-null executionId before invoking the data-object API","Obtain the id from ExecutionEntity.getId() of a freshly fetched execution","If execution context is unavailable, resolve it via runtimeService.createExecutionQuery() on the process instance id","Treat this as a programming bug: log and fail fast upstream where the id is produced"],"exampleFix":"// before\nDataObject d = runtimeService.getDataObject(executionId, \"objectName\"); // executionId may be null\n// after\nif (executionId != null) {\n    DataObject d = runtimeService.getDataObject(executionId, \"objectName\");\n}","handlingStrategy":"validation","validationCode":"if (executionId == null || executionId.isEmpty()) return null;\nDataObject d = runtimeService.getDataObject(executionId, name);","typeGuard":"boolean hasExecutionId(String id) { return id != null && !id.isEmpty(); }","tryCatchPattern":null,"preventionTips":["Capture ExecutionEntity.getId() at the point the execution is fetched","Null-check optional id sources before engine calls","Avoid holding execution ids across transaction boundaries"],"tags":["flowable","null-argument","data-object"],"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"}