open-bpmn
open-bpmn copied to clipboard
Fix wrong usage of glsp method findElementByClass
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!