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

Model APIs generate random ID on read

XMLWordPrintable

      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

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

                Created:
                Updated:
                Resolved: