|
|
@@ -15,7 +15,7 @@ import org.springframework.util.DigestUtils; |
|
|
|
import org.springframework.util.ObjectUtils; |
|
|
|
import work.xuye.common.constant.*; |
|
|
|
import work.xuye.common.db.entity.Task; |
|
|
|
import work.xuye.common.db.entity.vo.NextTaskFilter; |
|
|
|
import work.xuye.common.db.entity.vo.Dispatcher; |
|
|
|
import work.xuye.common.db.entity.vo.TaskMiniVO; |
|
|
|
import work.xuye.common.db.service.TaskManager; |
|
|
|
import work.xuye.common.dto.HttpRequestParams; |
|
|
@@ -120,7 +120,7 @@ public class SourceHandler { |
|
|
|
return null; |
|
|
|
} |
|
|
|
|
|
|
|
if (Objects.nonNull(task.getNextFilter())) { |
|
|
|
if (Objects.nonNull(task.getDispatcher())) { |
|
|
|
|
|
|
|
Map<String, Message> nextNodeMessage = buildNextNodeMessage(result, task, message); |
|
|
|
|
|
|
@@ -163,7 +163,7 @@ public class SourceHandler { |
|
|
|
} |
|
|
|
|
|
|
|
private Map<String, Message> buildNextNodeMessage(List<HttpRes> result, Task task, Message<TaskMiniVO> message) { |
|
|
|
NextTaskFilter filter = task.getNextFilter(); |
|
|
|
Dispatcher filter = task.getDispatcher(); |
|
|
|
|
|
|
|
Map<String, Message> resultMap = new HashMap<>(); |
|
|
|
result.stream() |
|
|
@@ -174,7 +174,7 @@ public class SourceHandler { |
|
|
|
.headers(item.getHeaders()) |
|
|
|
.requestParams(item.getRequestParams()); |
|
|
|
httpRes.setResourceStatus(item.getResourceStatus()); |
|
|
|
httpRes.setTemporary(JsonPathUtil.read(item.getBody(), task.getNextFilter().getFilterArgs())); |
|
|
|
httpRes.setTemporary(JsonPathUtil.read(item.getBody(), task.getDispatcher().getFilterArgs())); |
|
|
|
return httpRes; |
|
|
|
}) |
|
|
|
.flatMap(item -> { |
|
|
@@ -210,7 +210,7 @@ public class SourceHandler { |
|
|
|
} |
|
|
|
|
|
|
|
// 节点命中 |
|
|
|
List<NextTaskFilter.NextNodeConfig> nextNodes = filter.getNextNodes(); |
|
|
|
List<Dispatcher.NextNodeConfig> nextNodes = filter.getNextNodes(); |
|
|
|
if (ObjectUtils.isEmpty(nextNodes)) { |
|
|
|
return; |
|
|
|
} |
|
|
@@ -218,7 +218,7 @@ public class SourceHandler { |
|
|
|
context.setVariable("filterArgs", map); |
|
|
|
context.setVariable("httpRes", httpRes); |
|
|
|
|
|
|
|
for (NextTaskFilter.NextNodeConfig nextNode : nextNodes) { |
|
|
|
for (Dispatcher.NextNodeConfig nextNode : nextNodes) { |
|
|
|
|
|
|
|
if (!Boolean.TRUE.equals(getPlaceholderSpel(nextNode.getCondition(), filter.getPlaceholderExpressions(), context, Boolean.class))) { |
|
|
|
continue; |
|
|
|