Skip to content

Commit

Permalink
Updated Workflow Interface (opensearch-project#30)
Browse files Browse the repository at this point in the history
* Updated Workflow Interface

Signed-off-by: Owais Kazi <[email protected]>

* Updated method definition to handle input/output

Signed-off-by: Owais Kazi <[email protected]>

---------

Signed-off-by: Owais Kazi <[email protected]>
  • Loading branch information
owaiskazi19 authored Sep 13, 2023
1 parent 9655f07 commit 0f0b65d
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -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 {}
Original file line number Diff line number Diff line change
Expand Up @@ -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<Workflow> execute() throws Exception;
CompletableFuture<WorkflowData> execute(@Nullable WorkflowData data);

/**
*
* @return the name of this workflow step.
*/
String getName();

}

0 comments on commit 0f0b65d

Please sign in to comment.