Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,8 @@ protected FlowInstanceConfigurer next(@NonNull FlowTaskInstance nextNode,

FlowInstanceConfigurer configurer = nextInternal(nextNode, serviceTaskConsumer,
userManuTaskConsumer, userTimerTaskConsumer);
String userTaskName = FlowNodeType.APPROVAL_TASK.name() + "_callback_task_" + getNameSuffix(nextNode);
String userTaskName =
FlowNodeType.APPROVAL_TASK.name() + RuntimeTaskConstants.CALLBACK_TASK + getNameSuffix(nextNode);
UserTaskBuilder userTaskBuilder = nullSafeGetNodeBuilder(userTaskName, nextNode, () -> {
UserTaskBuilder utb = new UserTaskBuilder(userTaskName);
return utb;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
import com.oceanbase.odc.service.flow.model.FlowTaskExecutionStrategy;
import com.oceanbase.odc.service.flow.task.BaseRuntimeFlowableDelegate;
import com.oceanbase.odc.service.flow.task.mapper.RuntimeDelegateMapper;
import com.oceanbase.odc.service.flow.task.model.RuntimeTaskConstants;

import lombok.Getter;
import lombok.NonNull;
Expand Down Expand Up @@ -267,7 +268,9 @@ private void complete(boolean aborted) {
Verify.verify(getStatus() == FlowNodeStatus.PENDING, "Task status is illegal: " + getStatus());

List<FlowableElement> elements =
flowableAdaptor.getFlowableElementByType(getId(), getNodeType(), FlowableElementType.USER_TASK);
flowableAdaptor.getFlowableElementByType(getId(), getNodeType(), FlowableElementType.USER_TASK)
.stream().filter(t -> !t.getName().contains(RuntimeTaskConstants.CALLBACK_TASK))
.collect(Collectors.toList());
Verify.verify(!elements.isEmpty(), "Can not find any user task related to task instance, id " + getId());
log.info("Get the execution node of the task instance, instanceId={}, elements={}", getId(), elements);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
import com.oceanbase.odc.service.flow.FlowableAdaptor;
import com.oceanbase.odc.service.flow.model.FlowNodeStatus;
import com.oceanbase.odc.service.flow.model.FlowNodeType;
import com.oceanbase.odc.service.flow.task.model.RuntimeTaskConstants;
import com.oceanbase.odc.service.schedule.ScheduleService;
import com.oceanbase.odc.service.schedule.model.ScheduleStatus;

Expand Down Expand Up @@ -175,7 +176,7 @@ private Optional<Task> getFlowableTask(FlowInstanceEntity flowInstance, String t
List<Task> tasks = flowableTaskService.createTaskQuery().taskName(taskName)
.processInstanceId(flowInstance.getProcessInstanceId())
.processDefinitionId(flowInstance.getProcessDefinitionId())
.list().stream().filter(a -> taskName != null && taskName.contains("callback"))
.list().stream().filter(a -> taskName != null && taskName.contains(RuntimeTaskConstants.CALLBACK_TASK))
.collect(Collectors.toList());
if (CollectionUtils.isEmpty(tasks)) {
log.info("Task not found, processInstanceId={}, processDefinitionId={}, taskName={}.",
Expand All @@ -192,7 +193,7 @@ private FlowableElement getFlowableElementOfUserTask(long flowTaskInstanceId) {
this.flowableAdaptor.getFlowableElementByType(flowTaskInstanceId, FlowNodeType.SERVICE_TASK,
FlowableElementType.USER_TASK).stream()
.filter(a -> a.getName() != null && a.getName()
.contains("callback"))
.contains(RuntimeTaskConstants.CALLBACK_TASK))
.collect(Collectors.toList());
if (CollectionUtils.isEmpty(flowableElements)) {
throw new IllegalStateException("No flowable element is found by id " + flowTaskInstanceId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,5 @@ public class RuntimeTaskConstants {
public static final String RISKLEVEL = "riskLevel";
public static final String SUCCESS_CREATE_EXT_INS = "successCreateExternalApprovalInstance";
public static final String CLOUD_MAIN_ACCOUNT_ID = "cloudMainAccountId";

public static final String CALLBACK_TASK = "_callback_task_";
}