-
Bug Report
-
Resolution: Fixed
-
L3 - Default
-
None
-
None
The base elements of all Model APIs have to following code snippet in there constructor:
public CmmnElementImpl(ModelTypeInstanceContext instanceContext) { super(instanceContext); if (getId() == null) { setId(ModelUtil.getUniqueIdentifier(getElementType())); } }
This generates a Random ID if no ID is set. It isn't a good idea to do this in the constructor as it is also called on read of a file. So if the file doesn't contain an ID for the process/case/decision a new random one will be generated. Which differs between reads.
Instead we could generate this ID only if the model API is used to create elements.
XML:
https://github.com/camunda/camunda-xml-model/commit/da89a71a144e2a70e8781ed13fc6aad5aa48b538
BPMN:
https://github.com/camunda/camunda-bpmn-model/commit/d5712adaba4759451df90369c56047d76d99024f
CMMN:
https://github.com/camunda/camunda-cmmn-model/commit/ee114434e5dc256fa0caf6e08aaaae5afb790fed
DMN (DMN-11 branch):
https://github.com/camunda/camunda-dmn-model/commit/bc186d64cbfae0ec6a832cbd1c959f4108e42efd