Skip to content
docsv0.1.0

PendingDecision

A gate that {@see HumanGate::openFor()} has opened (or {@see HumanGate::pendingFor()} has found already open) and is now awaiting a human decision on. `$options` is the gate's transition names; the constructor enforces they equal `$artifact->options()` 1:1 (order-insensitive) — the artifact<->gate invariant every {@see DecisionSurfaceInterface} this package builds a `PendingDecision` around must satisfy, so a stale or mismatched artifact fails loudly at construction rather than silently offering options the gate does not actually have.

PendingDecision::__construct()

public function __construct(string $instanceId, string $gateId, string $assignee, Milpa\Orchestrator\DecisionSurfaceInterface $artifact, array $options):

Parameters

Parameters of __construct()
NameTypeDescription
$instanceIdstringthe process instance this decision belongs to
$gateIdstringthe opened gate's code (e.g. `review_gate_gate`)
$assigneestringthe role expected to resolve this gate (the gate's approver role)
$artifactDecisionSurfaceInterfacethe decision surface built for this gate
$optionslist<string>the transition names available to resolve this gate with

Throws

\InvalidArgumentException when `$artifact->options()` does not equal `$options` 1:1 (order-insensitive) — the artifact<->gate invariant