letaoj commented on code in PR #138:
URL: https://github.com/apache/flink-agents/pull/138#discussion_r2347604825
##########
runtime/src/main/java/org/apache/flink/agents/runtime/operator/ActionExecutionOperator.java:
##########
@@ -301,20 +309,47 @@ private void processActionTaskForKey(Object key) throws
Exception {
// 2. Invoke the action task.
createAndSetRunnerContext(actionTask);
- ActionTask.ActionTaskResult actionTaskResult = actionTask.invoke();
- for (Event actionOutputEvent : actionTaskResult.getOutputEvents()) {
+
+ boolean isFinished = false;
+ List<Event> outputEvents;
+ Optional<ActionTask> generatedActionTaskOpt;
+ ActionState actionState = actionStateStore.get(key, actionTask.action);
+ if (actionState != null) {
+ isFinished = actionState.getGeneratedActionTask().isPresent();
+ outputEvents = actionState.getOutputEvents();
+ generatedActionTaskOpt = actionState.getGeneratedActionTask();
+ for (MemoryUpdate memoryUpdate : actionState.getMemoryUpdates()) {
+ actionTask
+ .getRunnerContext()
+ .getShortTermMemory()
+ .set(memoryUpdate.getPath(), memoryUpdate.getValue());
+ }
+ } else {
Review Comment:
Updated the condition to also check the generated actiontask is null
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]