open-bpmn icon indicating copy to clipboard operation
open-bpmn copied to clipboard

Fix wrong usage of glsp method findElementByClass

Open rsoika opened this issue 1 year ago • 0 comments

The method call modelState.getIndex().findElementByClass() is used in the wrong way and need to be replaced.

Instead of using

    Optional<BPMNGNode> _baseElement = modelState.getIndex().findElementByClass(elementID, BPMNGNode.class);
            gModelElement = _baseElement.orElse(null);

We can simply use:

  gModelElement = modelState.getIndex().get(elementID).orElse(null);          

There are several places in code where the wrong method findElementByClass is used!

rsoika avatar Mar 06 '24 15:03 rsoika