mirror of
https://github.com/slhaf/Partner.git
synced 2026-05-12 08:43:02 +08:00
refactor(ActionExecutor): remove useless method getHistoryActionResults
This commit is contained in:
@@ -117,8 +117,9 @@ public class ActionExecutor extends AgentRunningSubModule<ActionExecutorInput, V
|
|||||||
val result = metaAction.getResult();
|
val result = metaAction.getResult();
|
||||||
do {
|
do {
|
||||||
val actionData = phaserRecord.actionData();
|
val actionData = phaserRecord.actionData();
|
||||||
val historyActionResults = assemblyHelper.getHistoryActionResults(actionData);
|
val executingStage = actionData.getExecutingStage();
|
||||||
val additionalContext = actionData.getAdditionalContext().get(actionData.getExecutingStage());
|
val historyActionResults = actionData.getHistory().get(executingStage);
|
||||||
|
val additionalContext = actionData.getAdditionalContext().get(executingStage);
|
||||||
val extractorInput = assemblyHelper.buildExtractorInput(metaAction, userId, historyActionResults, additionalContext);
|
val extractorInput = assemblyHelper.buildExtractorInput(metaAction, userId, historyActionResults, additionalContext);
|
||||||
val extractorResult = paramsExtractor.execute(extractorInput);
|
val extractorResult = paramsExtractor.execute(extractorInput);
|
||||||
|
|
||||||
@@ -130,7 +131,7 @@ public class ActionExecutor extends AgentRunningSubModule<ActionExecutorInput, V
|
|||||||
historyAction.setDescription(actionCapability.loadMetaActionInfo(actionKey).getDescription());
|
historyAction.setDescription(actionCapability.loadMetaActionInfo(actionKey).getDescription());
|
||||||
historyAction.setResult(metaAction.getResult().getData());
|
historyAction.setResult(metaAction.getResult().getData());
|
||||||
actionData.getHistory()
|
actionData.getHistory()
|
||||||
.computeIfAbsent(actionData.getExecutingStage(), integer -> new ArrayList<>())
|
.computeIfAbsent(executingStage, integer -> new ArrayList<>())
|
||||||
.add(historyAction);
|
.add(historyAction);
|
||||||
} else {
|
} else {
|
||||||
val repairerInput = assemblyHelper.buildRepairerInput(historyActionResults, metaAction, userId);
|
val repairerInput = assemblyHelper.buildRepairerInput(historyActionResults, metaAction, userId);
|
||||||
@@ -193,25 +194,6 @@ public class ActionExecutor extends AgentRunningSubModule<ActionExecutorInput, V
|
|||||||
return input;
|
return input;
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<HistoryAction> getHistoryActionResults(ActionData actionData) {
|
|
||||||
int executingStage = actionData.getExecutingStage();
|
|
||||||
if (executingStage <= 0) {
|
|
||||||
return new ArrayList<>();
|
|
||||||
}
|
|
||||||
Map<Integer, List<MetaAction>> actionChain = actionData.getActionChain();
|
|
||||||
// executingStage 是当前正在执行的阶段,所以只需要获取到前一阶段的结果
|
|
||||||
return actionChain.get(executingStage - 1).stream()
|
|
||||||
.map(metaAction -> {
|
|
||||||
HistoryAction historyAction = new HistoryAction();
|
|
||||||
historyAction.setActionKey(metaAction.getKey());
|
|
||||||
historyAction
|
|
||||||
.setDescription(
|
|
||||||
actionCapability.loadMetaActionInfo(metaAction.getKey()).getDescription());
|
|
||||||
historyAction.setResult(metaAction.getResult().getData());
|
|
||||||
return historyAction;
|
|
||||||
}).toList();
|
|
||||||
}
|
|
||||||
|
|
||||||
private CorrectorInput buildCorrectorInput() {
|
private CorrectorInput buildCorrectorInput() {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user