Share via


OrchestrationRunner Class

  • java.lang.Object
    • com.microsoft.durabletask.OrchestrationRunner

public final class OrchestrationRunner

Helper class for invoking orchestrations directly, without constructing a DurableTaskGrpcWorker object.

This static class can be used to execute orchestration logic directly. In order to use it for this purpose, the caller must provide orchestration state as serialized protobuf bytes.

Method Summary

Modifier and Type Method and Description
static byte[] loadAndRun(byte[] orchestratorRequestBytes, OrchestratorFunction<R> orchestratorFunc)

Loads orchestration history from orchestratorRequestBytes and uses it to execute the orchestrator function code pointed to by orchestratorFunc.

static java.lang.String loadAndRun(String base64EncodedOrchestratorRequest, OrchestratorFunction<R> orchestratorFunc)

Loads orchestration history from base64EncodedOrchestratorRequest and uses it to execute the orchestrator function code pointed to by orchestratorFunc.

static byte[] loadAndRun(byte[] orchestratorRequestBytes, TaskOrchestration orchestration)

Loads orchestration history from orchestratorRequestBytes and uses it to execute the orchestration.

static java.lang.String loadAndRun(String base64EncodedOrchestratorRequest, TaskOrchestration orchestration)

Loads orchestration history from base64EncodedOrchestratorRequest and uses it to execute the orchestration.

Methods inherited from java.lang.Object

java.lang.Object.clone java.lang.Object.equals java.lang.Object.finalize java.lang.Object.getClass java.lang.Object.hashCode java.lang.Object.notify java.lang.Object.notifyAll java.lang.Object.toString java.lang.Object.wait java.lang.Object.wait java.lang.Object.wait

Method Details

loadAndRun

public static byte[] loadAndRun(byte[] orchestratorRequestBytes, OrchestratorFunction orchestratorFunc)

Loads orchestration history from orchestratorRequestBytes and uses it to execute the orchestrator function code pointed to by orchestratorFunc.

Parameters:

orchestratorRequestBytes - the protobuf payload representing an orchestrator execution request
orchestratorFunc - a function that implements the orchestrator logic

Returns:

a protobuf-encoded payload of orchestrator actions to be interpreted by the external orchestration engine

loadAndRun

public static String loadAndRun(String base64EncodedOrchestratorRequest, OrchestratorFunction orchestratorFunc)

Loads orchestration history from base64EncodedOrchestratorRequest and uses it to execute the orchestrator function code pointed to by orchestratorFunc.

Parameters:

base64EncodedOrchestratorRequest - the base64-encoded protobuf payload representing an orchestrator execution request
orchestratorFunc - a function that implements the orchestrator logic

Returns:

a base64-encoded protobuf payload of orchestrator actions to be interpreted by the external orchestration engine

loadAndRun

public static byte[] loadAndRun(byte[] orchestratorRequestBytes, TaskOrchestration orchestration)

Loads orchestration history from orchestratorRequestBytes and uses it to execute the orchestration.

Parameters:

orchestratorRequestBytes - the protobuf payload representing an orchestrator execution request
orchestration - the orchestration to execute

Returns:

a protobuf-encoded payload of orchestrator actions to be interpreted by the external orchestration engine

loadAndRun

public static String loadAndRun(String base64EncodedOrchestratorRequest, TaskOrchestration orchestration)

Loads orchestration history from base64EncodedOrchestratorRequest and uses it to execute the orchestration.

Parameters:

base64EncodedOrchestratorRequest - the base64-encoded protobuf payload representing an orchestrator execution request
orchestration - the orchestration to execute

Returns:

a base64-encoded protobuf payload of orchestrator actions to be interpreted by the external orchestration engine

Applies to