Skip to content

Commit

Permalink
fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
rsoika committed Mar 6, 2023
1 parent f922166 commit 180211d
Showing 1 changed file with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
import org.eclipse.glsp.server.actions.SelectAction;
import org.eclipse.glsp.server.operations.CreateNodeOperation;
import org.openbpmn.bpmn.BPMNNS;
import org.openbpmn.bpmn.elements.BPMNProcess;
import org.openbpmn.bpmn.elements.core.BPMNElementNode;
import org.openbpmn.glsp.BPMNDiagramConfiguration;
import org.openbpmn.glsp.elements.CreateBPMNNodeOperationHandler;
Expand Down Expand Up @@ -109,15 +108,12 @@ public void executeOperation(final CreateNodeOperation operation) {
if (element.isPresent()) {
elementID = element.get().getId();
logger.debug("===== > add extension for element id: " + elementID);

BPMNProcess process = modelState.getBpmnModel().openDefaultProcess();
BPMNElementNode bpmnElement = process.findElementNodeById(elementID);
// open bpmn event element
BPMNElementNode bpmnElement = modelState.getBpmnModel().findElementNodeById(elementID);
if (bpmnElement != null) {
// add the new extension

if (extensions != null) {
for (BPMNExtension extension : extensions) {

if (extension.handlesElementTypeId(element.get().getType())) {
// verify that the namespace is added to the model
modelState.getBpmnModel().addNamespace(extension.getNamespace(),
Expand Down

0 comments on commit 180211d

Please sign in to comment.