Skip to content

Commit

Permalink
minor code fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
rsoika committed Feb 16, 2024
1 parent eab43c3 commit 65ccfd5
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,10 @@ public CreateBPMNEdgeOperationHandler(final String elementTypeId) {
super(elementTypeId);
}

@SuppressWarnings("null")
public CreateBPMNEdgeOperationHandler(final String... elementTypeIds) {
super(Lists.newArrayList(elementTypeIds));

}

public CreateBPMNEdgeOperationHandler(final List<String> handledElementTypeIds) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ public CreateBPMNNodeOperationHandler(final String elementTypeId) {
super(elementTypeId);
}

@SuppressWarnings("null")
public CreateBPMNNodeOperationHandler(final String... elementTypeIds) {
super(Lists.newArrayList(elementTypeIds));
}
Expand Down Expand Up @@ -83,7 +84,6 @@ protected BPMNProcess findProcessByCreateNodeOperation(final CreateNodeOperation
return BPMNGModelUtil.findProcessByPoint(modelState, dropPoint);
}


/**
* This method is a helper method to compute the container element. E.g. when a
* EventDefinition is placed into a Event or when a Extension is placed into a
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,14 @@ public void executeOperation(final CreateNodeOperation operation) {
event = activity.addBoundaryEvent(eventID, getLabel());
} else {
// normal event
event = bpmnProcess.addEvent(eventID, getLabel(), operation.getElementTypeId());
if (bpmnProcess != null) {
event = bpmnProcess.addEvent(eventID, getLabel(), operation.getElementTypeId());
}
}

Optional<GPoint> point = operation.getLocation();

if (point.isPresent()) {
if (event != null && point.isPresent()) {
// compute relative center position...
BPMNPoint targetPosition = BPMNGridSnapper.center(event, point.get());
// compute default label position
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -365,26 +365,6 @@ public int compare(Lane obj1, Lane obj2) {
}
}

/**
* Helper method that findes a specific GNode in a GNodeList
*
* @param id
* @param gNodeList
* @return
*/
private GModelElement findPoolGNode(String id, List<GModelElement> gNodeList) {
if (id == null) {
return null;
}
for (GModelElement element : gNodeList) {
if (id.equals(element.getId())) {
return element;
}
}
// no match
return null;
}

/**
* This method apply all possible BPMNElementExtension to the GNode. This is to
* build
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,9 @@ private void executeOperation(final BPMNApplyPropertiesUpdateOperation operation

// finally we need to update the JSONFormsData property of the selected element
// See also issue #164
gModelElement.getArgs().put("JSONFormsData", json.toString());
if (gModelElement != null) {
gModelElement.getArgs().put("JSONFormsData", json.toString());
}
logger.debug("....execute Update " + operation.getId() + " in " + (System.currentTimeMillis() - l) + "ms");

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ private void executeOperation(final DeleteOperation operation) {

List<String> elementIds = operation.getElementIds();
if (elementIds == null || elementIds.size() == 0) {
System.out.println("Elements to delete are not specified");
logger.fine("Elements to delete are not specified");
return;
}
for (String id : elementIds) {
// test if the element is a participant
Expand Down

0 comments on commit 65ccfd5

Please sign in to comment.