RecommendationWorkflowUiService
in package
uses
LocatorAwareTrait
Builds recommendation approval workflow context for recommendation screens.
Table of Contents
Properties
Methods
- __construct() : mixed
- buildContext() : array<string, mixed>
- Build workflow display and action context for a recommendation.
- canStartApprovalWorkflow() : bool
- Determine whether a new approval workflow can be started.
- pendingApprovalForRecommendation() : WorkflowApproval|null
- Return the current user's pending approval for a recommendation, if any.
- approvalsByProcessStepKey() : array<string, WorkflowApproval>
- Index workflow approvals by their Awards approval-process step key.
- approvalStepLabel() : string
- Return a human-friendly label for an approval gate.
- buildProcessStepSummary() : array<string, mixed>
- Build progress from Awards approval-process steps, including future steps not yet materialized.
- buildRunSummary() : array<string, mixed>
- Build progress details for a specific approval run.
- buildSummary() : array<string, mixed>
- Build high-level workflow progress for the current recommendation.
- canStartWorkflow() : bool
- currentStepSequence() : int|null
- Find the configured sequence for the current approval process step.
- formatApprovalResponses() : array<int, array<string, string>>
- Format approval responses for concise progress summaries.
- formatRuns() : array<int, array<string, mixed>>
- loadRuns() : array<int, RecommendationApprovalRun>
- pendingApprovalForIdentity() : WorkflowApproval|null
Properties
$lifecycle
private
RecommendationApprovalWorkflowLifecycleService
$lifecycle
Methods
__construct()
public
__construct([RecommendationApprovalWorkflowLifecycleService|null $lifecycle = null ]) : mixed
Parameters
- $lifecycle : RecommendationApprovalWorkflowLifecycleService|null = null
-
Lifecycle service.
buildContext()
Build workflow display and action context for a recommendation.
public
buildContext(Recommendation $recommendation, KmpIdentityInterface|null $identity) : array<string, mixed>
Parameters
- $recommendation : Recommendation
-
Recommendation.
- $identity : KmpIdentityInterface|null
-
Current identity.
Return values
array<string, mixed>canStartApprovalWorkflow()
Determine whether a new approval workflow can be started.
public
canStartApprovalWorkflow(Recommendation $recommendation) : bool
Parameters
- $recommendation : Recommendation
-
Recommendation.
Return values
boolpendingApprovalForRecommendation()
Return the current user's pending approval for a recommendation, if any.
public
pendingApprovalForRecommendation(Recommendation $recommendation, KmpIdentityInterface|null $identity) : WorkflowApproval|null
Parameters
- $recommendation : Recommendation
-
Recommendation.
- $identity : KmpIdentityInterface|null
-
Current identity.
Return values
WorkflowApproval|nullapprovalsByProcessStepKey()
Index workflow approvals by their Awards approval-process step key.
private
approvalsByProcessStepKey(array<int, mixed> $approvals) : array<string, WorkflowApproval>
Parameters
- $approvals : array<int, mixed>
-
Materialized approvals.
Return values
array<string, WorkflowApproval>approvalStepLabel()
Return a human-friendly label for an approval gate.
private
approvalStepLabel(WorkflowApproval $approval, RecommendationApprovalRun $run) : string
Parameters
- $approval : WorkflowApproval
-
Approval gate.
- $run : RecommendationApprovalRun
-
Approval run.
Return values
stringbuildProcessStepSummary()
Build progress from Awards approval-process steps, including future steps not yet materialized.
private
buildProcessStepSummary(RecommendationApprovalRun $run, array<int, mixed> $approvals, array<int, mixed> $processSteps) : array<string, mixed>
Parameters
- $run : RecommendationApprovalRun
-
Approval run.
- $approvals : array<int, mixed>
-
Materialized workflow approvals.
- $processSteps : array<int, mixed>
-
Configured approval-process steps.
Return values
array<string, mixed>buildRunSummary()
Build progress details for a specific approval run.
private
buildRunSummary(RecommendationApprovalRun $run) : array<string, mixed>
Parameters
- $run : RecommendationApprovalRun
-
Approval run.
Return values
array<string, mixed>buildSummary()
Build high-level workflow progress for the current recommendation.
private
buildSummary(RecommendationApprovalRun|null $latestRun) : array<string, mixed>
Parameters
- $latestRun : RecommendationApprovalRun|null
-
Latest run.
Return values
array<string, mixed>canStartWorkflow()
private
canStartWorkflow(Recommendation $recommendation, RecommendationApprovalRun|null $latestRun, array<int, RecommendationApprovalRun> $activeRuns) : bool
Parameters
- $recommendation : Recommendation
-
Recommendation.
- $latestRun : RecommendationApprovalRun|null
-
Latest run.
- $activeRuns : array<int, RecommendationApprovalRun>
-
Active runs.
Return values
boolcurrentStepSequence()
Find the configured sequence for the current approval process step.
private
currentStepSequence(array<int, mixed> $processSteps, string $currentStepKey) : int|null
Parameters
- $processSteps : array<int, mixed>
-
Configured process steps.
- $currentStepKey : string
-
Current step key.
Return values
int|nullformatApprovalResponses()
Format approval responses for concise progress summaries.
private
formatApprovalResponses(WorkflowApproval $approval) : array<int, array<string, string>>
Parameters
- $approval : WorkflowApproval
-
Approval gate.
Return values
array<int, array<string, string>>formatRuns()
private
formatRuns(array<int, RecommendationApprovalRun> $runs) : array<int, array<string, mixed>>
Parameters
- $runs : array<int, RecommendationApprovalRun>
-
Runs.
Return values
array<int, array<string, mixed>>loadRuns()
private
loadRuns(array<string|int, int> $scopeIds) : array<int, RecommendationApprovalRun>
Parameters
- $scopeIds : array<string|int, int>
-
Recommendation scope IDs.
Return values
array<int, RecommendationApprovalRun>pendingApprovalForIdentity()
private
pendingApprovalForIdentity(array<int, RecommendationApprovalRun> $activeRuns, KmpIdentityInterface|null $identity) : WorkflowApproval|null
Parameters
- $activeRuns : array<int, RecommendationApprovalRun>
-
Active runs.
- $identity : KmpIdentityInterface|null
-
Current identity.