KMP PHP API Reference

WorkflowActionRegistry
in package

Workflow Action Registry

Static registry for executable workflow actions. Plugins register actions that workflow nodes can invoke (e.g., 'Officers.CreateOfficerRecord'). Follows the ViewCellRegistry pattern for consistency.

Table of Contents

Constants

APPROVAL_OUTPUT_SCHEMA  : mixed = ['status' => ['type' => 'string', 'label' => 'A...
Output schema for approval nodes.
REQUIRED_FIELDS  : mixed = ['action', 'label', 'description', 'inputSchema...
Required fields for each action registration.

Properties

$actions  : array<string|int, mixed>
$initialized  : bool

Methods

clear()  : void
Clear all registered actions.
getAction()  : array<string|int, mixed>|null
Get a single action by action name.
getActionsBySource()  : array<string|int, mixed>
Get actions for a specific source.
getAllActions()  : array<string|int, mixed>
Get all registered actions.
getDebugInfo()  : array<string|int, mixed>
Get debug information about registered actions.
getForDesigner()  : array<string|int, mixed>
Get a simplified view for the visual designer UI.
getRegisteredSources()  : array<string|int, mixed>
Get all registered source identifiers.
isRegistered()  : bool
Check if a source is registered.
register()  : void
Register actions from a source plugin.
unregister()  : void
Remove actions from a specific source.
ensureInitialized()  : void
Ensure the registry is initialized.
validateRequiredFields()  : void
Validate that required fields are present in a registration entry.

Constants

APPROVAL_OUTPUT_SCHEMA

Output schema for approval nodes.

public mixed APPROVAL_OUTPUT_SCHEMA = ['status' => ['type' => 'string', 'label' => 'Approval Status'], 'approverId' => ['type' => 'integer', 'label' => 'Approver Member ID'], 'comment' => ['type' => 'string', 'label' => 'Approval Comment'], 'rejectionComment' => ['type' => 'string', 'label' => 'Rejection Comment'], 'decision' => ['type' => 'string', 'label' => 'Decision (approve/reject)']]

Used by the designer UI variable picker.

REQUIRED_FIELDS

Required fields for each action registration.

private mixed REQUIRED_FIELDS = ['action', 'label', 'description', 'inputSchema', 'outputSchema', 'serviceClass', 'serviceMethod']

Properties

Methods

getAction()

Get a single action by action name.

public static getAction(string $actionName) : array<string|int, mixed>|null
Parameters
$actionName : string

Action identifier (e.g., 'Officers.CreateOfficerRecord')

Return values
array<string|int, mixed>|null

Action configuration or null if not found

getActionsBySource()

Get actions for a specific source.

public static getActionsBySource(string $source) : array<string|int, mixed>
Parameters
$source : string

Source identifier

Return values
array<string|int, mixed>

Actions from the specified source

getAllActions()

Get all registered actions.

public static getAllActions() : array<string|int, mixed>
Return values
array<string|int, mixed>

All actions keyed by source

getDebugInfo()

Get debug information about registered actions.

public static getDebugInfo() : array<string|int, mixed>
Return values
array<string|int, mixed>

Debug information

getForDesigner()

Get a simplified view for the visual designer UI.

public static getForDesigner() : array<string|int, mixed>
Return values
array<string|int, mixed>

Designer-safe action data (no class names)

getRegisteredSources()

Get all registered source identifiers.

public static getRegisteredSources() : array<string|int, mixed>
Return values
array<string|int, mixed>

List of registered source identifiers

isRegistered()

Check if a source is registered.

public static isRegistered(string $source) : bool
Parameters
$source : string

Source identifier

Return values
bool

True if registered

register()

Register actions from a source plugin.

public static register(string $source, array<string|int, mixed> $actions) : void
Parameters
$source : string

Source identifier (e.g., 'Officers', 'Awards')

$actions : array<string|int, mixed>

Array of action configurations

Tags
throws
InvalidArgumentException

If required fields are missing

unregister()

Remove actions from a specific source.

public static unregister(string $source) : void
Parameters
$source : string

Source identifier to remove

ensureInitialized()

Ensure the registry is initialized.

private static ensureInitialized() : void

validateRequiredFields()

Validate that required fields are present in a registration entry.

private static validateRequiredFields(array<string|int, mixed> $entry, array<string|int, mixed> $requiredFields, string $source) : void
Parameters
$entry : array<string|int, mixed>

Registration entry to validate

$requiredFields : array<string|int, mixed>

Required field names

$source : string

Source identifier for error messages

Tags
throws
InvalidArgumentException

If required fields are missing

On this page

Search results