feat(REQ-5865) - 解决 triggerAsync 后,业务节点文案消失的问题
This commit is contained in:
parent
0905bb396d
commit
7d85b3ebdd
@ -287,6 +287,10 @@ public class CustomTaskHelper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void addComment(CommandContext commandContext, TaskEntity task, String type, String message) {
|
public static void addComment(CommandContext commandContext, TaskEntity task, String type, String message) {
|
||||||
|
addComment(commandContext, task, type, message, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void addComment(CommandContext commandContext, TaskEntity task, String type, String message, boolean withVariableLocal) {
|
||||||
if (!StringUtils.hasText(type) || !StringUtils.hasText(message)) {
|
if (!StringUtils.hasText(type) || !StringUtils.hasText(message)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -311,7 +315,11 @@ public class CustomTaskHelper {
|
|||||||
comment.setFullMessage(message);
|
comment.setFullMessage(message);
|
||||||
|
|
||||||
processEngineConfiguration.getCommentEntityManager().insert(comment);
|
processEngineConfiguration.getCommentEntityManager().insert(comment);
|
||||||
task.setTransientVariableLocal(type, message);
|
if (withVariableLocal) {
|
||||||
|
task.setVariableLocal(type, message);
|
||||||
|
} else {
|
||||||
|
task.setTransientVariableLocal(type, message);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Attachment addAttachment(CommandContext commandContext, Task task, AttachmentDTO attachmentDto) {
|
public static Attachment addAttachment(CommandContext commandContext, Task task, AttachmentDTO attachmentDto) {
|
||||||
|
|||||||
@ -46,6 +46,7 @@ import java.util.Collections;
|
|||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
import java.util.Optional;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import static cn.axzo.workflow.common.constant.BpmnConstants.AND_SIGN_EXPRESSION;
|
import static cn.axzo.workflow.common.constant.BpmnConstants.AND_SIGN_EXPRESSION;
|
||||||
@ -280,7 +281,7 @@ public class TaskEntityEventHandle implements EntityEventHandle<TaskEntity> {
|
|||||||
if (Objects.nonNull(advice) && StringUtils.hasText(advice.toString())) {
|
if (Objects.nonNull(advice) && StringUtils.hasText(advice.toString())) {
|
||||||
update.setAdvice(advice.toString());
|
update.setAdvice(advice.toString());
|
||||||
}
|
}
|
||||||
Object operationDesc = taskEntity.getTransientVariableLocal(COMMENT_TYPE_OPERATION_DESC);
|
Object operationDesc = Optional.ofNullable(taskEntity.getTransientVariableLocal(COMMENT_TYPE_OPERATION_DESC)).orElse(taskEntity.getVariableLocal(COMMENT_TYPE_OPERATION_DESC));
|
||||||
if (Objects.nonNull(operationDesc) && StringUtils.hasText(operationDesc.toString())) {
|
if (Objects.nonNull(operationDesc) && StringUtils.hasText(operationDesc.toString())) {
|
||||||
update.setOperationDesc(Objects.nonNull(assignee) ?
|
update.setOperationDesc(Objects.nonNull(assignee) ?
|
||||||
(StringUtils.hasText(assignee.getAssignerName()) ? assignee.getAssignerName() : "") + operationDesc
|
(StringUtils.hasText(assignee.getAssignerName()) ? assignee.getAssignerName() : "") + operationDesc
|
||||||
@ -290,6 +291,7 @@ public class TaskEntityEventHandle implements EntityEventHandle<TaskEntity> {
|
|||||||
(StringUtils.hasText(assignee.getAssignerName()) ? assignee.getAssignerName() : "")
|
(StringUtils.hasText(assignee.getAssignerName()) ? assignee.getAssignerName() : "")
|
||||||
: "");
|
: "");
|
||||||
}
|
}
|
||||||
|
taskEntity.removeVariableLocal(COMMENT_TYPE_OPERATION_DESC);
|
||||||
|
|
||||||
|
|
||||||
String completionType = taskEntity.getVariable(TASK_COMPLETE_OPERATION_TYPE + taskEntity.getId(), String.class);
|
String completionType = taskEntity.getVariable(TASK_COMPLETE_OPERATION_TYPE + taskEntity.getId(), String.class);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user