Skip to content

Commit

Permalink
fixed
Browse files Browse the repository at this point in the history
Issue imixs#182
  • Loading branch information
rsoika committed Feb 17, 2023
1 parent d8f8d6a commit 5328a3f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,7 @@ public void executeOperation(final DeleteOperation operation) {
System.out.println("Elements to delete are not specified");
}
for (String id : elementIds) {
// Update the source model
System.out.println("...delete Element " + id);
// test if the element is a participant or a FlowElement
// test if the element is a participant
Participant participant = modelState.getBpmnModel().findParticipantById(id);
if (participant != null) {
// delete participant with the pool and all contained elements
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -755,30 +755,31 @@ public void deleteLane(String id) {
* @param id
*/
public void deleteElementNode(String id) {
BPMNElementNode bpmnElement = findElementNodeById(id);
if (bpmnElement == null) {
// does not exist
logger.warning("Element '" + id + "' does not exists in current process!");
return;
}

// test if the element is a lane
// First test if the element is a lane
Lane lane = this.findLaneById(id);
if (lane != null) {
this.deleteLane(id);
return;
}

// remove all flows
BPMNElementNode bpmnElement = findElementNodeById(id);
if (bpmnElement == null) {
// does not exist
logger.warning("Element '" + id + "' does not exists in current process!");
return;
}

// remove all flows...
removeAllEdgesFromElement(bpmnElement.getId());

// delete the shape
// delete the shape....
this.getElementNode().removeChild(bpmnElement.getElementNode());
if (bpmnElement.getBpmnShape() != null) {
model.getBpmnPlane().removeChild(bpmnElement.getBpmnShape());
}

// finally delete the element from the corresponding list
// ...and finally delete the element from the corresponding element list
if (bpmnElement instanceof Activity) {
this.getActivities().remove(bpmnElement);
}
Expand Down

0 comments on commit 5328a3f

Please sign in to comment.