From f45ac2a5c1941c12b887ae0bd823b74c3ee75fe6 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 13 Sep 2023 21:27:34 +0000 Subject: [PATCH] Updated Workflow Interface (#30) * Updated Workflow Interface Signed-off-by: Owais Kazi * Updated method definition to handle input/output Signed-off-by: Owais Kazi --------- Signed-off-by: Owais Kazi (cherry picked from commit 0f0b65ddd27722831846006490fc54207097eeeb) Signed-off-by: github-actions[bot] --- .../flowframework/workflow/WorkflowData.java | 14 ++++++++++++++ .../workflow/{Workflow.java => WorkflowStep.java} | 15 +++++++++++---- 2 files changed, 25 insertions(+), 4 deletions(-) create mode 100644 src/main/java/org/opensearch/flowframework/workflow/WorkflowData.java rename src/main/java/org/opensearch/flowframework/workflow/{Workflow.java => WorkflowStep.java} (64%) 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/Workflow.java b/src/main/java/org/opensearch/flowframework/workflow/WorkflowStep.java similarity index 64% rename from src/main/java/org/opensearch/flowframework/workflow/Workflow.java rename to src/main/java/org/opensearch/flowframework/workflow/WorkflowStep.java index 634877bec..6a65ce6e3 100644 --- a/src/main/java/org/opensearch/flowframework/workflow/Workflow.java +++ b/src/main/java/org/opensearch/flowframework/workflow/WorkflowStep.java @@ -8,19 +8,26 @@ */ package org.opensearch.flowframework.workflow; +import org.opensearch.common.Nullable; + import java.util.concurrent.CompletableFuture; /** * Interface for the workflow setup of different building blocks. */ -public interface Workflow { +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. - * @throws Exception if execution fails */ - CompletableFuture execute() throws Exception; + CompletableFuture execute(@Nullable WorkflowData data); + + /** + * + * @return the name of this workflow step. + */ + String getName(); }