{"record":{"id":"501e3a12c08901fc","repo":"flowable/flowable-engine","slug":"process-definition-info-node-is-null","errorCode":null,"errorMessage":"process definition info node is null","messagePattern":"process definition info node is null","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine/src/main/java/org/flowable/engine/impl/cmd/SaveProcessDefinitionInfoCmd.java","lineNumber":50,"sourceCode":"\n    private static final long serialVersionUID = 1L;\n\n    protected String processDefinitionId;\n    protected ObjectNode infoNode;\n\n    public SaveProcessDefinitionInfoCmd(String processDefinitionId, ObjectNode infoNode) {\n        this.processDefinitionId = processDefinitionId;\n        this.infoNode = infoNode;\n    }\n\n    @Override\n    public Void execute(CommandContext commandContext) {\n        if (processDefinitionId == null) {\n            throw new FlowableIllegalArgumentException(\"process definition id is null\");\n        }\n\n        if (infoNode == null) {\n            throw new FlowableIllegalArgumentException(\"process definition info node is null\");\n        }\n\n        ProcessDefinitionInfoEntityManager definitionInfoEntityManager = CommandContextUtil.getProcessDefinitionInfoEntityManager(commandContext);\n        ProcessDefinitionInfoEntity definitionInfoEntity = definitionInfoEntityManager.findProcessDefinitionInfoByProcessDefinitionId(processDefinitionId);\n        if (definitionInfoEntity == null) {\n            definitionInfoEntity = definitionInfoEntityManager.create();\n            definitionInfoEntity.setProcessDefinitionId(processDefinitionId);\n            CommandContextUtil.getProcessDefinitionInfoEntityManager().insertProcessDefinitionInfo(definitionInfoEntity);\n        }\n\n        try {\n            ObjectWriter writer = CommandContextUtil.getProcessEngineConfiguration(commandContext).getObjectMapper().writer();\n            CommandContextUtil.getProcessDefinitionInfoEntityManager().updateInfoJson(definitionInfoEntity.getId(), writer.writeValueAsBytes(infoNode));\n        } catch (Exception e) {\n            throw new FlowableException(\"Unable to serialize info node \" + infoNode, e);\n        }\n\n        return null;","sourceCodeStart":32,"sourceCodeEnd":68,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine/src/main/java/org/flowable/engine/impl/cmd/SaveProcessDefinitionInfoCmd.java#L32-L68","documentation":"SaveProcessDefinitionInfoCmd.execute throws FlowableIllegalArgumentException when the infoNode (an ObjectNode holding the process definition info JSON) is null. The node is the payload to persist, so without it there is nothing to save. This guard runs after the processDefinitionId null check.","triggerScenarios":"Calling managementService.saveProcessDefinitionInfo(processDefinitionId, null) or executing new SaveProcessDefinitionInfoCmd(id, null).","commonSituations":"Parsing the info JSON failed and the caller forwarded a null node; a builder/parse method returned null silently; a variable holding the JSON node was never initialized.","solutions":["Pass a non-null ObjectNode as the info node; create one with the engine's ObjectMapper if needed.","Check the result of whatever produced the node (e.g. objectMapper.readTree) for null before calling the API.","If there is truly no info to save, skip the call instead of passing null."],"exampleFix":"// before\nmanagementService.saveProcessDefinitionInfo(pdId, null);\n// after\nObjectNode infoNode = CommandContextUtil.getProcessEngineConfiguration().getObjectMapper().createObjectNode();\ninfoNode.put(\"field\", \"value\");\nmanagementService.saveProcessDefinitionInfo(pdId, infoNode);","handlingStrategy":"validation","validationCode":"if (infoNode == null) {\n    infoNode = objectMapper.createObjectNode(); // or skip the call entirely\n}\nmanagementService.saveProcessDefinitionInfo(processDefinitionId, infoNode);","typeGuard":"boolean hasInfoNode = infoNode != null && infoNode instanceof ObjectNode;","tryCatchPattern":null,"preventionTips":["Always build the info node explicitly with objectMapper.createObjectNode().","Treat readTree() results as nullable and handle null before use.","Prefer skipping the save when there is no info rather than passing null."],"tags":["flowable","null-argument","json-node","validation"],"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"}