{"record":{"id":"cbae822f723c7a08","repo":"flowable/flowable-engine","slug":"no-flow-element-with-id-elementid-found-in-bpmnm","errorCode":null,"errorMessage":"No flow element with id <elementId> found in bpmnmodel <processId>","messagePattern":"No flow element with id <elementId> found in bpmnmodel <processId>","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine/src/main/java/org/flowable/engine/dynamic/DynamicProcessDefinitionSummary.java","lineNumber":94,"sourceCode":"     * <li>\n     * UserTask\n     * </li>\n     * <li>\n     * ScriptTask\n     * </li>\n     * </ul> No summary will field will be created for other elements. ElementId, and elementType will be available.\n     * \n     * @param elementId\n     *            the id of the {@link org.flowable.bpmn.model.FlowElement}.\n     * @return an {@link ObjectNode} with the provided structure.\n     * @throws IllegalStateException\n     *             if no {@link org.flowable.bpmn.model.FlowElement} is found for the provided id.\n     */\n    public ObjectNode getElement(String elementId) throws IllegalStateException {\n\n        FlowElement flowElement = bpmnModel.getFlowElement(elementId);\n        if (flowElement == null) {\n            throw new IllegalStateException(\"No flow element with id \" + elementId + \" found in bpmnmodel \" + bpmnModel.getMainProcess().getId());\n        }\n\n        PropertiesParser propertiesParser = summaryParsers.get(flowElement.getClass().getSimpleName());\n        ObjectNode bpmnProperties = getBpmnProperties(elementId, processInfo);\n        if (propertiesParser != null) {\n            return propertiesParser.parseElement(flowElement, bpmnProperties, objectMapper);\n        } else {\n            // if there is no parser for an element we have to use the default summary parser.\n            return defaultParser.parseElement(flowElement, bpmnProperties, objectMapper);\n        }\n    }\n\n    public ObjectNode getSummary() {\n        ObjectNode summary = objectMapper.createObjectNode();\n\n        for (Process process : bpmnModel.getProcesses()) {\n            for (FlowElement flowElement : process.getFlowElements()) {\n                summary.set(flowElement.getId(), getElement(flowElement.getId()));","sourceCodeStart":76,"sourceCodeEnd":112,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine/src/main/java/org/flowable/engine/dynamic/DynamicProcessDefinitionSummary.java#L76-L112","documentation":"DynamicProcessDefinitionSummary.getElement looks up a FlowElement by id in the process definition's BpmnModel to summarize its properties. If no element with that id exists, it throws IllegalStateException, indicating the requested element id is not part of the model.","triggerScenarios":"Calling getElement(elementId) (directly or via getSummary()/jsonNode()) with an elementId absent from the BpmnModel — e.g. querying a changed/deleted element id against the original model, or an id from a different process definition.","commonSituations":"Dynamic process injection UIs requesting info for an element that was never deployed; mismatch between the process definition the summary was built for and the element ids supplied; case-sensitivity or whitespace issues in element ids.","solutions":["Verify the elementId exists in the deployed BPMN model before querying","Check which process definition the summary was constructed from and use element ids from that same definition","Catch IllegalStateException and return a friendly 'element not found' response to the client"],"exampleFix":"// before\nObjectNode props = summary.getElement(elementId);\n// after\nFlowElement fe = summary.getBpmnModel().getFlowElement(elementId);\nif (fe == null) {\n    throw new IllegalArgumentException(\"Unknown element id: \" + elementId);\n}\nObjectNode props = summary.getElement(elementId);","handlingStrategy":"validation","validationCode":"boolean exists = bpmnModel.getFlowElement(elementId) != null;","typeGuard":"function elementExists(summary, id) { try { return summary.getElement(id) != null; } catch (IllegalStateException e) { return false; } }","tryCatchPattern":"try { node = summary.getElement(elementId); } catch (IllegalStateException e) { return ResponseEntity.status(404).body(\"Unknown element id\"); }","preventionTips":["Validate element ids against the deployed model before summarizing","Keep the summary's process definition id alongside requested element ids","Trim and normalize element ids from client input","Return 404-style responses for unknown elements instead of surfacing the raw exception"],"tags":["flowable","bpmn","dynamic-process"],"backgroundTag":"record-not-found","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"}