Durable Workflow PHP SDK — API Reference

Guides

WorkflowClientFake
in package
implements WorkflowClientInterface

FinalYes

Records workflow client interactions and supplies configured test results.

Table of Contents

Interfaces

WorkflowClientInterface
The application-facing workflow operations implemented by Client and its test fake.

Properties

$messages  : array<int, array{workflow_id: string, stream_name: string, message_id: string, position: int, arguments: list, payload_identity: string}>
$queries  : array<int, array{workflow_id: string, name: string, arguments: list}>
$queryResults  : array<string, mixed>
$results  : array<int, string>
$signals  : array<int, array{workflow_id: string, name: string, arguments: list}>
$starts  : array<int, array{workflow_type: string, workflow_id: string, task_queue: string, input: list}>
$updateResults  : array<string, mixed>
$updates  : array<int, array{workflow_id: string, name: string, arguments: list}>
$workflowResults  : array<string, mixed>
$workflowStreamAppendResults  : array<string, WorkflowStreamAppendResult>
$workflowStreamCloseResults  : array<string, WorkflowStreamDescription>
$workflowStreamPages  : array<string, WorkflowStreamPage>
$workflowStreams  : array<string, array<int, WorkflowStreamDescription>>

Methods

appendMessage()  : array<string, mixed>
appendWorkflowStream()  : WorkflowStreamAppendResult
assertMessageAppended()  : void
assertQueryRequested()  : void
assertResultRequested()  : void
assertSignalSent()  : void
assertUpdateRequested()  : void
assertWorkflowStarted()  : void
closeWorkflowStream()  : WorkflowStreamDescription
describeWorkflowStream()  : WorkflowStreamDescription
iterateWorkflowStream()  : Generator<int, WorkflowStreamItem>
listWorkflowStreams()  : array<int, WorkflowStreamDescription>
query()  : mixed
result()  : mixed
setQueryResult()  : self
setUpdateResult()  : self
setWorkflowResult()  : self
setWorkflowStreamAppendResult()  : self
setWorkflowStreamCloseResult()  : self
setWorkflowStreamPage()  : self
setWorkflowStreams()  : self
signal()  : void
startWorkflow()  : WorkflowHandleInterface
subscribeWorkflowStream()  : WorkflowStreamPage
update()  : mixed
workflowHandle()  : WorkflowHandleInterface
assertInteraction()  : void
configured()  : mixed
key()  : string
streamKey()  : string

Properties

$messages

private array<int, array{workflow_id: string, stream_name: string, message_id: string, position: int, arguments: list, payload_identity: string}> $messages = []

$queries

private array<int, array{workflow_id: string, name: string, arguments: list}> $queries = []

$signals

private array<int, array{workflow_id: string, name: string, arguments: list}> $signals = []

$starts

private array<int, array{workflow_type: string, workflow_id: string, task_queue: string, input: list}> $starts = []

$updates

private array<int, array{workflow_id: string, name: string, arguments: list}> $updates = []

Methods

appendMessage()

public appendMessage(string $workflowId, string $streamName, string $messageId, array<int, mixed> $arguments) : array<string, mixed>
Parameters
$workflowId : string
$streamName : string
$messageId : string
$arguments : array<int, mixed>
Return values
array<string, mixed>

assertMessageAppended()

public assertMessageAppended(string $workflowId, string $streamName, string $messageId[, array<int, mixed>|null $arguments = null ]) : void
Parameters
$workflowId : string
$streamName : string
$messageId : string
$arguments : array<int, mixed>|null = null

assertQueryRequested()

public assertQueryRequested(string $workflowId, string $name[, array<int, mixed>|null $arguments = null ]) : void
Parameters
$workflowId : string
$name : string
$arguments : array<int, mixed>|null = null

assertResultRequested()

public assertResultRequested(string $workflowId) : void
Parameters
$workflowId : string

assertSignalSent()

public assertSignalSent(string $workflowId, string $name[, array<int, mixed>|null $arguments = null ]) : void
Parameters
$workflowId : string
$name : string
$arguments : array<int, mixed>|null = null

assertUpdateRequested()

public assertUpdateRequested(string $workflowId, string $name[, array<int, mixed>|null $arguments = null ]) : void
Parameters
$workflowId : string
$name : string
$arguments : array<int, mixed>|null = null

assertWorkflowStarted()

public assertWorkflowStarted(string $workflowType[, array<int, mixed>|null $input = null ][, string|null $workflowId = null ][, string|null $taskQueue = null ]) : void
Parameters
$workflowType : string
$input : array<int, mixed>|null = null
$workflowId : string|null = null
$taskQueue : string|null = null

closeWorkflowStream()

public closeWorkflowStream(string $workflowId, string $runId, string $streamName[, string|null $errorReason = null ][, int|null $retentionSeconds = null ]) : WorkflowStreamDescription
Parameters
$workflowId : string
$runId : string
$streamName : string
$errorReason : string|null = null
$retentionSeconds : int|null = null
Return values
WorkflowStreamDescription

iterateWorkflowStream()

public iterateWorkflowStream(string $workflowId, string $runId, string $streamName[, int $fromOffset = 0 ][, int $maxItems = 100 ][, int $waitSeconds = 30 ][, callable|null $cancelled = null ]) : Generator<int, WorkflowStreamItem>
Parameters
$workflowId : string
$runId : string
$streamName : string
$fromOffset : int = 0
$maxItems : int = 100
$waitSeconds : int = 30
$cancelled : callable|null = null
Return values
Generator<int, WorkflowStreamItem>

query()

public query(string $workflowId, string $name, array<int, mixed> $arguments) : mixed
Parameters
$workflowId : string
$name : string
$arguments : array<int, mixed>

setQueryResult()

public setQueryResult(string $workflowId, string $name, mixed $result) : self
Parameters
$workflowId : string
$name : string
$result : mixed
Return values
self

setUpdateResult()

public setUpdateResult(string $workflowId, string $name, mixed $result) : self
Parameters
$workflowId : string
$name : string
$result : mixed
Return values
self

setWorkflowResult()

public setWorkflowResult(string $workflowId, mixed $result) : self
Parameters
$workflowId : string
$result : mixed
Return values
self

setWorkflowStreamPage()

public setWorkflowStreamPage(string $workflowId, string $runId, string $streamName, int $fromOffset, WorkflowStreamPage $page) : self
Parameters
$workflowId : string
$runId : string
$streamName : string
$fromOffset : int
$page : WorkflowStreamPage
Return values
self

signal()

public signal(string $workflowId, string $name, array<int, mixed> $arguments) : void
Parameters
$workflowId : string
$name : string
$arguments : array<int, mixed>

startWorkflow()

public startWorkflow(string $workflowType, string $workflowId, string $taskQueue[, array<int, mixed> $input = [] ][, int $executionTimeoutSeconds = 3600 ][, int $runTimeoutSeconds = 600 ][, string|null $duplicatePolicy = null ][, array<string|int, mixed>|null $memo = null ][, array<string|int, mixed>|null $searchAttributes = null ][, int|null $priority = null ][, string|null $fairnessKey = null ][, int|null $fairnessWeight = null ][, string|null $buildId = null ]) : WorkflowHandleInterface
Parameters
$workflowType : string
$workflowId : string
$taskQueue : string
$input : array<int, mixed> = []
$executionTimeoutSeconds : int = 3600
$runTimeoutSeconds : int = 600
$duplicatePolicy : string|null = null
$memo : array<string|int, mixed>|null = null
$searchAttributes : array<string|int, mixed>|null = null
$priority : int|null = null
$fairnessKey : string|null = null
$fairnessWeight : int|null = null
$buildId : string|null = null
Return values
WorkflowHandleInterface

subscribeWorkflowStream()

public subscribeWorkflowStream(string $workflowId, string $runId, string $streamName[, int $fromOffset = 0 ][, int $maxItems = 100 ][, int $waitSeconds = 0 ][, callable|null $cancelled = null ]) : WorkflowStreamPage
Parameters
$workflowId : string
$runId : string
$streamName : string
$fromOffset : int = 0
$maxItems : int = 100
$waitSeconds : int = 0
$cancelled : callable|null = null
Return values
WorkflowStreamPage

update()

public update(string $workflowId, string $name, array<int, mixed> $arguments) : mixed
Parameters
$workflowId : string
$name : string
$arguments : array<int, mixed>

assertInteraction()

private assertInteraction(array<int, array{workflow_id: string, name: string, arguments: list}> $interactions, string $kind, string $workflowId, string $name, array<int, mixed>|null $arguments) : void
Parameters
$interactions : array<int, array{workflow_id: string, name: string, arguments: list}>
$kind : string
$workflowId : string
$name : string
$arguments : array<int, mixed>|null

configured()

private configured(array<string, mixed> $configured, string $workflowId, string $name, string $kind) : mixed
Parameters
$configured : array<string, mixed>
$workflowId : string
$name : string
$kind : string

key()

private key(string $workflowId, string $name) : string
Parameters
$workflowId : string
$name : string
Return values
string

streamKey()

private streamKey(string $workflowId, string $runId[, string $streamName = '' ][, int|null $fromOffset = null ]) : string
Parameters
$workflowId : string
$runId : string
$streamName : string = ''
$fromOffset : int|null = null
Return values
string
On this page

Search results