Uploaded image for project: 'Kogito'
  1. Kogito
  2. KOGITO-5132

BPMN Editor - Improve SVG generated ids

    XMLWordPrintable

    Details

      Description

      Problem

      Once exporting a process into an SVG, the editor may generate duplicated identifiers when dealing with some shapes (eg: reusable subprocess), also identifiers may contian unuseful strings concatenated like "undefined". This situation can lead into potential issues when dealing the SVG DOM models.

      Also the consumers for the generated proceses' SVGs, like the runtime UIs, have the need for being able to find concerte elements in the SVG  in order to provide user actions on top. For instance, clicking in a reusable subprocess in order to drill down into the refferred process view.

      Proposed solution

      The goal for this task is to improve the generated ids when exporting the process into an SVG model, by providing also information about the SVG model being used to generate the shape.

      Implementation details

      If an element in any of the source BPMN SVG shapes [2], already contains an identifier, it will be also used in the exported SVG for the process, by appending it into the generated ids. 

      For instance, the identifier "subProcessReusableNormalReusableIcon[1] will be appended into the id for the generated process' SVG , once using a reusable subprocess with id "_BE5F68FE-3CE9-457A-A08F-3BA9DDF0B22C", so providing an output like:

       

      <path id="_BE5F68FE-3CE9-457A-A08F-3BA9DDF0B22C_subProcessReusableNormalReusableIcon" ....>
      

       [1] https://github.com/kiegroup/kie-wb-common/blob/master/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/resources/org/kie/workbench/common/stunner/bpmn/client/resources/images/shapes/subprocess.svg?short_path=fed3c0c#L32

        [2] https://github.com/kiegroup/kie-wb-common/tree/master/kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-client/src/main/resources/org/kie/workbench/common/stunner/bpmn/client/resources/images/shapes

       

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              roger600 Roger Martinez
              Reporter:
              roger600 Roger Martinez
              Tester:
              Jan Stastny Jan Stastny
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: