KMP PHP API Reference

WorkflowApprovalManagerInterface

Interface for managing workflow approval gates and responses.

Table of Contents

Methods

cancelApprovalsForInstance()  : ServiceResult
Cancel all pending approvals for a workflow instance.
createApproval()  : ServiceResult
Create an approval gate for a workflow node.
getApprovalsForInstance()  : array<string|int, WorkflowApproval>
Get all approvals for a workflow instance.
getEligibleApprovers()  : array<string|int, Member>
Get possible member candidates for approval picker/reassignment UIs.
getNextApproverCandidates()  : array<string|int, int>
Get member IDs that can be selected as the next approver.
getPendingApprovalsForMember()  : array<string|int, WorkflowApproval>
Get pending approvals the member can act on right now.
isResolved()  : bool
Check if an approval gate has been resolved.
reassignApproval()  : ServiceResult
Reassign a pending approval to a different eligible member.
recordResponse()  : ServiceResult
Record a member's approval decision.

Methods

createApproval()

Create an approval gate for a workflow node.

public createApproval(int $instanceId, string $nodeId, int $executionLogId, array<string|int, mixed> $config) : ServiceResult
Parameters
$instanceId : int
$nodeId : string
$executionLogId : int
$config : array<string|int, mixed>
Return values
ServiceResult

getEligibleApprovers()

Get possible member candidates for approval picker/reassignment UIs.

public getEligibleApprovers(int $approvalId) : array<string|int, Member>

This is broader candidate discovery and must not be used as the final current-user response authorization check.

Parameters
$approvalId : int
Return values
array<string|int, Member>

getNextApproverCandidates()

Get member IDs that can be selected as the next approver.

public getNextApproverCandidates(int $approvalId[, int|null $currentMemberId = null ]) : array<string|int, int>
Parameters
$approvalId : int

Workflow approval ID

$currentMemberId : int|null = null

Current responding member to exclude

Return values
array<string|int, int>

getPendingApprovalsForMember()

Get pending approvals the member can act on right now.

public getPendingApprovalsForMember(int $memberId) : array<string|int, WorkflowApproval>

Implementations should delegate to the canonical WorkflowApprovalsTable pending eligibility helpers so queues and response recording stay aligned.

Parameters
$memberId : int
Return values
array<string|int, WorkflowApproval>

isResolved()

Check if an approval gate has been resolved.

public isResolved(int $approvalId) : bool
Parameters
$approvalId : int
Return values
bool

reassignApproval()

Reassign a pending approval to a different eligible member.

public reassignApproval(int $approvalId, int $newApproverId, int $adminMemberId[, string|null $reason = null ]) : ServiceResult
Parameters
$approvalId : int

Workflow approval ID

$newApproverId : int

Member ID to reassign to

$adminMemberId : int

Admin performing the reassignment

$reason : string|null = null

Optional reason

Return values
ServiceResult

recordResponse()

Record a member's approval decision.

public recordResponse(int $approvalId, int $memberId, string $decision[, string|null $comment = null ][, int|null $nextApproverId = null ][, array<string, mixed> $approverConfigUpdates = [] ]) : ServiceResult
Parameters
$approvalId : int

Workflow approval ID

$memberId : int

Responding member ID

$decision : string

'approve' or 'reject'

$comment : string|null = null

Optional comment

$nextApproverId : int|null = null

Optional next approver for serial pick-next chains

$approverConfigUpdates : array<string, mixed> = []

Config values to commit atomically with the response

Return values
ServiceResult
On this page

Search results