{"record":{"id":"dcdadf491c804931","repo":"flowable/flowable-engine","slug":"only-provided-id-generation-allowed-for-properties","errorCode":null,"errorMessage":"only provided id generation allowed for properties","messagePattern":"only provided id generation allowed for properties","errorType":"exception","errorClass":"FlowableException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/persistence/entity/PropertyEntityImpl.java","lineNumber":72,"sourceCode":"\n    @Override\n    public void setValue(String value) {\n        this.value = value;\n    }\n\n    @Override\n    public String getId() {\n        return name;\n    }\n\n    @Override\n    public Object getPersistentState() {\n        return value;\n    }\n\n    @Override\n    public void setId(String id) {\n        throw new FlowableException(\"only provided id generation allowed for properties\");\n    }\n\n    // common methods //////////////////////////////////////////////////////////\n\n    @Override\n    public String toString() {\n        return \"PropertyEntity[name=\" + name + \", value=\" + value + \"]\";\n    }\n\n}\n","sourceCodeStart":54,"sourceCodeEnd":83,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/persistence/entity/PropertyEntityImpl.java#L54-L83","documentation":"PropertyEntityImpl.setId deliberately throws FlowableException: property entities (engine configuration rows like next.dbid) use a fixed, provided ID (the property name), so changing the ID programmatically is not allowed. Only the engine's own id generation is permitted.","triggerScenarios":"Calling setId(...) on a PropertyEntity instance, typically via code that generically assigns ids to entities or mutates properties after creation.","commonSituations":"Generic persistence/serialization code invoking setId on all entities; custom code building PropertyEntity objects and then trying to rename the property; reflection-based mappers assigning ids.","solutions":["Set the id through the PropertyEntityImpl constructor (new PropertyEntityImpl(name, value)) instead of setId","Never mutate the id of an existing property; create a new property entity with the desired name","Adjust generic entity-handling code to skip setId for PropertyEntity"],"exampleFix":"// before\nPropertyEntityImpl prop = new PropertyEntityImpl();\nprop.setId(\"next.dbid\"); // throws\n// after\nPropertyEntityImpl prop = new PropertyEntityImpl(\"next.dbid\", \"1\");","handlingStrategy":"type-guard","validationCode":"if (entity instanceof PropertyEntity) {\n    // don't call setId; id is the property name set via constructor\n}","typeGuard":"void safeSetId(Object entity, String id) {\n    if (entity instanceof PropertyEntity) throw new UnsupportedOperationException(\"property ids are immutable\");\n}","tryCatchPattern":"try {\n    propertyEntity.setId(id);\n} catch (FlowableException e) {\n    if (e.getMessage().contains(\"only provided id generation allowed\")) {\n        // recreate property with desired name instead\n    }\n    throw e;\n}","preventionTips":["Construct PropertyEntityImpl with the id/name in the constructor","Skip setId in generic entity hydration for PropertyEntity","Treat property ids as immutable"],"tags":["property-entity","unsupported-operation","id-generation"],"backgroundTag":"unsupported-operation","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"}