Uploaded image for project: 'camunda BPM'
  1. camunda BPM
  2. CAM-4898

Model APIs generate random ID on read

      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.

        This is the controller panel for Smart Panels app

            [CAM-4898] Model APIs generate random ID on read

            Sebastian Menski added a comment - 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

              roman.smirnov Roman Smirnov
              sebastian.menski Sebastian Menski
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: