WorkflowClientInterface
extends
ClientContextInterface
in
Table of Contents
Methods
- countWorkflowExecutions() : CountWorkflowExecutions
- Get count of workflow executions using List Filter Query syntax.
- getServiceClient() : ServiceClientInterface
- getWorkflowHistory() : WorkflowExecutionHistory
- listWorkflowExecutions() : Paginator<string|int, WorkflowExecutionInfo>
- Get paginated list of workflow executions using List Filter Query syntax.
- newActivityCompletionClient() : ActivityCompletionClientInterface
- Creates a new `ActivityCompletionClient` that can be used to complete activities asynchronously.
- newRunningWorkflowStub() : T
- Returns workflow stub associated with running workflow.
- newUntypedRunningWorkflowStub() : WorkflowStubInterface
- Returns untyped workflow stub associated with running workflow.
- newUntypedWorkflowStub() : WorkflowStubInterface
- Creates workflow untyped client stub that can be used to start a single workflow execution. After workflow is started it can be also used to send signals or queries to it.
- newWorkflowStub() : T
- Creates workflow client stub that can be used to start a single workflow execution.
- signalWithStart() : WorkflowRunInterface
- Starts untyped and typed workflow stubs in async mode. Sends signal on start.
- start() : WorkflowRunInterface
- Starts workflow in async mode.
- startWithSignal() : WorkflowRunInterface
- updateWithStart() : UpdateHandle
- Starts untyped and typed workflow stubs in async mode. Sends Update on start.
- withDeadline() : static
- Set the deadline for any service requests
- withMetadata() : static
- A metadata map to send to the server
- withRetryOptions() : static
- withTimeout() : static
- All the service client calls will be made with the specified timeout.
Methods
countWorkflowExecutions()
Get count of workflow executions using List Filter Query syntax.
public
countWorkflowExecutions(non-empty-string $query[, non-empty-string|null $namespace = null ]) : CountWorkflowExecutions
Query example:
WorkflowType='MyWorkflow' and StartTime between '2022-08-22T15:04:05+00:00' and '2023-08-22T15:04:05+00:00'
Parameters
- $query : non-empty-string
- $namespace : non-empty-string|null = null
-
If null, the preconfigured namespace will be used.
Tags
Return values
CountWorkflowExecutionsgetServiceClient()
public
getServiceClient() : ServiceClientInterface
Return values
ServiceClientInterfacegetWorkflowHistory()
public
getWorkflowHistory(WorkflowExecution $execution[, non-empty-string|null $namespace = null ][, bool $waitNewEvent = false ][, int $historyEventFilterType = HistoryEventFilterType::HISTORY_EVENT_FILTER_TYPE_ALL_EVENT ][, bool $skipArchival = false ][, int<0, max> $pageSize = 0 ]) : WorkflowExecutionHistory
Parameters
- $execution : WorkflowExecution
- $namespace : non-empty-string|null = null
-
If null, the preconfigured namespace will be used.
- $waitNewEvent : bool = false
-
If set to true, the RPC call will not resolve until there is a new event which matches, the $historyEventFilterType, or a timeout is hit. The RPC call will be resolved immediately if the workflow was already finished.
- $historyEventFilterType : int = HistoryEventFilterType::HISTORY_EVENT_FILTER_TYPE_ALL_EVENT
- $skipArchival : bool = false
- $pageSize : int<0, max> = 0
-
Size of the pages to be requested. It affects internal queries only. Use it if you want to load limited number of events from the history.
Return values
WorkflowExecutionHistorylistWorkflowExecutions()
Get paginated list of workflow executions using List Filter Query syntax.
public
listWorkflowExecutions(non-empty-string $query[, non-empty-string|null $namespace = null ][, int<0, max> $pageSize = 10 ]) : Paginator<string|int, WorkflowExecutionInfo>
Query example:
WorkflowType='MyWorkflow' and StartTime between '2022-08-22T15:04:05+00:00' and '2023-08-22T15:04:05+00:00'
Parameters
- $query : non-empty-string
- $namespace : non-empty-string|null = null
-
If null, the preconfigured namespace will be used.
- $pageSize : int<0, max> = 10
-
Maximum number of workflow info per page.
Tags
Return values
Paginator<string|int, WorkflowExecutionInfo>newActivityCompletionClient()
Creates a new `ActivityCompletionClient` that can be used to complete activities asynchronously.
public
newActivityCompletionClient() : ActivityCompletionClientInterface
Only relevant for activity implementations that called ActivityContext::doNotCompleteOnReturn().
Tags
Return values
ActivityCompletionClientInterfacenewRunningWorkflowStub()
Returns workflow stub associated with running workflow.
public
newRunningWorkflowStub(T> $class, string $workflowID[, string|null $runID = null ]) : T
Parameters
- $class : T>
- $workflowID : string
- $runID : string|null = null
Tags
Return values
TnewUntypedRunningWorkflowStub()
Returns untyped workflow stub associated with running workflow.
public
newUntypedRunningWorkflowStub(string $workflowID[, string|null $runID = null ][, string|null $workflowType = null ]) : WorkflowStubInterface
Parameters
- $workflowID : string
- $runID : string|null = null
- $workflowType : string|null = null
Return values
WorkflowStubInterfacenewUntypedWorkflowStub()
Creates workflow untyped client stub that can be used to start a single workflow execution. After workflow is started it can be also used to send signals or queries to it.
public
newUntypedWorkflowStub(string $workflowType[, WorkflowOptions|null $options = null ]) : WorkflowStubInterface
Use WorkflowClient->start($workflowStub, ...$args) to start workflow asynchronously.
IMPORTANT! Stub is per workflow instance. So new stub should be created for each new one.
Parameters
- $workflowType : string
- $options : WorkflowOptions|null = null
Return values
WorkflowStubInterfacenewWorkflowStub()
Creates workflow client stub that can be used to start a single workflow execution.
public
newWorkflowStub(T> $class[, WorkflowOptions|null $options = null ]) : T
The first call must be to a method annotated with WorkflowMethod. After workflow is started it can be also used to send signals or queries to it.
Use WorkflowClient->start($workflowStub, ...$args) to start workflow asynchronously.
IMPORTANT! Stub is per workflow instance. So new stub should be created for each new one.
Parameters
- $class : T>
- $options : WorkflowOptions|null = null
Tags
Return values
TsignalWithStart()
Starts untyped and typed workflow stubs in async mode. Sends signal on start.
public
signalWithStart(object|WorkflowStubInterface $workflow, non-empty-string $signal[, array<string|int, mixed> $signalArgs = [] ][, array<string|int, mixed> $startArgs = [] ]) : WorkflowRunInterface
Parameters
- $workflow : object|WorkflowStubInterface
- $signal : non-empty-string
- $signalArgs : array<string|int, mixed> = []
- $startArgs : array<string|int, mixed> = []
Tags
Return values
WorkflowRunInterfacestart()
Starts workflow in async mode.
public
start(WorkflowStubInterface|object $workflow, mixed ...$args) : WorkflowRunInterface
Returns WorkflowRun object which can be used to wait for the execution result. WorkflowRun objects created by typed workflow stubs will attempt to type the execution result as well.
Parameters
- $workflow : WorkflowStubInterface|object
- $args : mixed
Return values
WorkflowRunInterfacestartWithSignal()
public
startWithSignal(mixed $workflow, string $signal[, array<string|int, mixed> $signalArgs = [] ][, array<string|int, mixed> $startArgs = [] ]) : WorkflowRunInterface
Parameters
- $workflow : mixed
- $signal : string
- $signalArgs : array<string|int, mixed> = []
- $startArgs : array<string|int, mixed> = []
Tags
Return values
WorkflowRunInterfaceupdateWithStart()
Starts untyped and typed workflow stubs in async mode. Sends Update on start.
public
updateWithStart(object|WorkflowStubInterface $workflow, non-empty-string|UpdateOptions $update[, array<string|int, mixed> $updateArgs = [] ][, array<string|int, mixed> $startArgs = [] ]) : UpdateHandle
Parameters
- $workflow : object|WorkflowStubInterface
- $update : non-empty-string|UpdateOptions
-
Name of the update handler or update options.
- $updateArgs : array<string|int, mixed> = []
- $startArgs : array<string|int, mixed> = []
Tags
Return values
UpdateHandlewithDeadline()
Set the deadline for any service requests
public
withDeadline(DateTimeInterface $deadline) : static
Parameters
- $deadline : DateTimeInterface
Return values
staticwithMetadata()
A metadata map to send to the server
public
withMetadata(array<string, array<string|int, string>> $metadata) : static
Parameters
- $metadata : array<string, array<string|int, string>>
Return values
staticwithRetryOptions()
public
withRetryOptions(RpcRetryOptions $options) : static
Parameters
- $options : RpcRetryOptions
Return values
staticwithTimeout()
All the service client calls will be made with the specified timeout.
public
withTimeout(float $timeout) : static
Parameters
- $timeout : float
-
in seconds