From 9146e79148bc458466814e7aa42083e423203c0b Mon Sep 17 00:00:00 2001 From: Owais Kazi Date: Mon, 11 Sep 2023 17:35:32 -0700 Subject: [PATCH 1/2] Updated Workflow Interface Signed-off-by: Owais Kazi --- .../workflow/{Workflow.java => WorkflowStep.java} | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) rename src/main/java/org/opensearch/flowframework/workflow/{Workflow.java => WorkflowStep.java} (76%) diff --git a/src/main/java/org/opensearch/flowframework/workflow/Workflow.java b/src/main/java/org/opensearch/flowframework/workflow/WorkflowStep.java similarity index 76% rename from src/main/java/org/opensearch/flowframework/workflow/Workflow.java rename to src/main/java/org/opensearch/flowframework/workflow/WorkflowStep.java index 634877bec..ff75b4b47 100644 --- a/src/main/java/org/opensearch/flowframework/workflow/Workflow.java +++ b/src/main/java/org/opensearch/flowframework/workflow/WorkflowStep.java @@ -13,14 +13,19 @@ /** * Interface for the workflow setup of different building blocks. */ -public interface Workflow { +public interface WorkflowStep { /** * Triggers the processing of the building block. * * @return CompletableFuture of the building block. - * @throws Exception if execution fails */ - CompletableFuture execute() throws Exception; + CompletableFuture execute(); + + /** + * + * @return the name of this workflow step. + */ + String getName(); } From 3df12cf5e3cde1474116ca370096dc4acf830b3b Mon Sep 17 00:00:00 2001 From: Owais Kazi Date: Tue, 12 Sep 2023 15:37:46 -0700 Subject: [PATCH 2/2] Updated method definition to handle input/output Signed-off-by: Owais Kazi --- .../flowframework/workflow/WorkflowData.java | 14 ++++++++++++++ .../flowframework/workflow/WorkflowStep.java | 6 ++++-- 2 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 src/main/java/org/opensearch/flowframework/workflow/WorkflowData.java diff --git a/src/main/java/org/opensearch/flowframework/workflow/WorkflowData.java b/src/main/java/org/opensearch/flowframework/workflow/WorkflowData.java new file mode 100644 index 000000000..3e8dc81b2 --- /dev/null +++ b/src/main/java/org/opensearch/flowframework/workflow/WorkflowData.java @@ -0,0 +1,14 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + */ +package org.opensearch.flowframework.workflow; + +/** + * Interface for handling the input/output of the building blocks. + */ +public interface WorkflowData {} diff --git a/src/main/java/org/opensearch/flowframework/workflow/WorkflowStep.java b/src/main/java/org/opensearch/flowframework/workflow/WorkflowStep.java index ff75b4b47..6a65ce6e3 100644 --- a/src/main/java/org/opensearch/flowframework/workflow/WorkflowStep.java +++ b/src/main/java/org/opensearch/flowframework/workflow/WorkflowStep.java @@ -8,6 +8,8 @@ */ package org.opensearch.flowframework.workflow; +import org.opensearch.common.Nullable; + import java.util.concurrent.CompletableFuture; /** @@ -17,10 +19,10 @@ public interface WorkflowStep { /** * Triggers the processing of the building block. - * + * @param data for input/output params of the building blocks. * @return CompletableFuture of the building block. */ - CompletableFuture execute(); + CompletableFuture execute(@Nullable WorkflowData data); /** *