Skip to content

Commit

Permalink
fix(ticket): failed to approve ticket when input over-sized comment (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
smallsheeeep authored Jun 3, 2024
1 parent 2ab9636 commit 0bfa172
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
import javax.annotation.PreDestroy;
import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

import org.apache.commons.collections4.CollectionUtils;
import org.flowable.engine.HistoryService;
Expand Down Expand Up @@ -658,7 +659,10 @@ private FlowInstanceDetailResp cancel(@NotNull FlowInstance flowInstance, Boolea
return FlowInstanceDetailResp.withIdAndType(id, taskTypeHolder.getValue());
}

public FlowInstanceDetailResp approve(@NotNull Long id, String message, Boolean skipAuth) throws IOException {
@Transactional(rollbackFor = Exception.class)
public FlowInstanceDetailResp approve(@NotNull Long id,
@Size(max = 1024, message = "The approval comment is out of range [0,1024]") String message,
Boolean skipAuth) throws IOException {
TaskEntity taskEntity = getTaskByFlowInstanceId(id);
if (taskEntity.getTaskType() == TaskType.IMPORT && !dispatchChecker.isTaskEntityOnThisMachine(taskEntity)) {
/**
Expand All @@ -683,7 +687,9 @@ public FlowInstanceDetailResp approve(@NotNull Long id, String message, Boolean
}

@Transactional(rollbackFor = Exception.class)
public FlowInstanceDetailResp reject(@NotNull Long id, String message, Boolean skipAuth) {
public FlowInstanceDetailResp reject(@NotNull Long id,
@Size(max = 1024, message = "The approval comment is out of range [0,1024]") String message,
Boolean skipAuth) {
if (notificationProperties.isEnabled()) {
try {
Event event =
Expand Down

0 comments on commit 0bfa172

Please sign in to comment.