WorkflowContext
in package
FinalYes
Deterministic helpers available while a workflow generator is replayed.
Table of Contents
Properties
- $runId : string
- $workflowId : string
- $cancellationRequested : bool
- $codec : PayloadCodec
- $history : array<string|int, mixed>
Methods
- __construct() : mixed
- activity() : WorkflowCommand
- childWorkflow() : WorkflowCommand
- continueAsNew() : WorkflowCommand
- isCancellationRequested() : bool
- sideEffect() : WorkflowCommand
- signals() : array<int, array<int, mixed>>
- sleep() : WorkflowCommand
- throwIfCancellationRequested() : void
- updates() : array<int, array<int, mixed>>
- upsertSearchAttributes() : WorkflowCommand
Properties
$runId read-only
public
string
$runId
$workflowId read-only
public
string
$workflowId
$cancellationRequested read-only
private
bool
$cancellationRequested
= false
$codec read-only
private
PayloadCodec
$codec
$history read-only
private
array<string|int, mixed>
$history
Methods
__construct()
public
__construct(string $workflowId, string $runId, array<int, array<string, mixed>> $history, PayloadCodec $codec[, bool $cancellationRequested = false ]) : mixed
Parameters
- $workflowId : string
- $runId : string
- $history : array<int, array<string, mixed>>
- $codec : PayloadCodec
- $cancellationRequested : bool = false
activity()
public
activity(string $activityType[, array<int, mixed> $arguments = [] ][, array<string, mixed> $options = [] ]) : WorkflowCommand
Parameters
- $activityType : string
- $arguments : array<int, mixed> = []
- $options : array<string, mixed> = []
Return values
WorkflowCommandchildWorkflow()
public
childWorkflow(string $workflowType[, array<int, mixed> $arguments = [] ][, array<string, mixed> $options = [] ]) : WorkflowCommand
Parameters
- $workflowType : string
- $arguments : array<int, mixed> = []
- $options : array<string, mixed> = []
Return values
WorkflowCommandcontinueAsNew()
public
continueAsNew([array<int, mixed> $arguments = [] ][, string|null $workflowType = null ][, string|null $taskQueue = null ]) : WorkflowCommand
Parameters
- $arguments : array<int, mixed> = []
- $workflowType : string|null = null
- $taskQueue : string|null = null
Return values
WorkflowCommandisCancellationRequested()
public
isCancellationRequested() : bool
Return values
boolsideEffect()
public
sideEffect(callable(): mixed $operation) : WorkflowCommand
Parameters
- $operation : callable(): mixed
Return values
WorkflowCommandsignals()
public
signals(string $signalName) : array<int, array<int, mixed>>
Parameters
- $signalName : string
Return values
array<int, array<int, mixed>>sleep()
public
sleep(int|float $seconds) : WorkflowCommand
Parameters
- $seconds : int|float
Return values
WorkflowCommandthrowIfCancellationRequested()
public
throwIfCancellationRequested() : void
updates()
public
updates(string $updateName) : array<int, array<int, mixed>>
Parameters
- $updateName : string
Return values
array<int, array<int, mixed>>upsertSearchAttributes()
public
upsertSearchAttributes(array<string, mixed> $attributes) : WorkflowCommand
Parameters
- $attributes : array<string, mixed>