WorkflowInstance
extends BaseEntity
in package
WorkflowInstance Entity
A running or completed workflow execution, pinned to a specific workflow version. Tracks execution state, context, and active nodes.
Table of Contents
Constants
- ACTIVE_STATUSES : mixed = [self::STATUS_RUNNING, self::STATUS_WAITING]
- STATUS_CANCELLED : mixed = 'cancelled'
- STATUS_COMPLETED : mixed = 'completed'
- STATUS_FAILED : mixed = 'failed'
- STATUS_PENDING : mixed = 'pending'
- STATUS_RUNNING : mixed = 'running'
- STATUS_WAITING : mixed = 'waiting'
Properties
- $active_entity_key : string|null
- $active_nodes : array<string|int, mixed>|null
- $branch_id : int|null
- $completed_at : DateTime|null
- $context : array<string|int, mixed>|null
- $created : DateTime|null
- $entity_id : int|null
- $entity_type : string|null
- $error_info : array<string|int, mixed>|null
- $id : int
- $modified : DateTime|null
- $started_at : DateTime|null
- $started_by : int|null
- $status : string
- $workflow_approvals : array<string|int, WorkflowApproval>
- $workflow_definition : WorkflowDefinition
- $workflow_definition_id : int
- $workflow_execution_logs : array<string|int, WorkflowExecutionLog>
- $workflow_version : WorkflowVersion
- $workflow_version_id : int
- $_accessible : array<string, bool>
- Fields that can be mass assigned.
Methods
- getBranchId() : int|null
- Get the branch ID for authorization checks.
- isCompleted() : bool
- Check if the instance completed successfully.
- isRunning() : bool
- Check if the instance is currently running.
- isTerminal() : bool
- Check if the instance has reached a terminal state.
- isWaiting() : bool
- Check if the instance is waiting for external input.
Constants
ACTIVE_STATUSES
public
mixed
ACTIVE_STATUSES
= [self::STATUS_RUNNING, self::STATUS_WAITING]
STATUS_CANCELLED
public
mixed
STATUS_CANCELLED
= 'cancelled'
STATUS_COMPLETED
public
mixed
STATUS_COMPLETED
= 'completed'
STATUS_FAILED
public
mixed
STATUS_FAILED
= 'failed'
STATUS_PENDING
public
mixed
STATUS_PENDING
= 'pending'
STATUS_RUNNING
public
mixed
STATUS_RUNNING
= 'running'
STATUS_WAITING
public
mixed
STATUS_WAITING
= 'waiting'
Properties
$active_entity_key
public
string|null
$active_entity_key
$active_nodes
public
array<string|int, mixed>|null
$active_nodes
$branch_id
public
int|null
$branch_id
Associated branch ID (when applicable)
$completed_at
public
DateTime|null
$completed_at
$context
public
array<string|int, mixed>|null
$context
$created
public
DateTime|null
$created
$entity_id
public
int|null
$entity_id
$entity_type
public
string|null
$entity_type
$error_info
public
array<string|int, mixed>|null
$error_info
$id
public
int
$id
$modified
public
DateTime|null
$modified
$started_at
public
DateTime|null
$started_at
$started_by
public
int|null
$started_by
$status
public
string
$status
$workflow_approvals
public
array<string|int, WorkflowApproval>
$workflow_approvals
$workflow_definition
public
WorkflowDefinition
$workflow_definition
$workflow_definition_id
public
int
$workflow_definition_id
$workflow_execution_logs
public
array<string|int, WorkflowExecutionLog>
$workflow_execution_logs
$workflow_version
public
WorkflowVersion
$workflow_version
$workflow_version_id
public
int
$workflow_version_id
$_accessible
Fields that can be mass assigned.
protected
array<string, bool>
$_accessible
= ['workflow_definition_id' => true, 'workflow_version_id' => true, 'entity_type' => true, 'entity_id' => true, 'status' => true, 'context' => true, 'active_nodes' => true, 'error_info' => true, 'started_by' => true, 'started_at' => true, 'completed_at' => true]
Methods
getBranchId()
Get the branch ID for authorization checks.
public
getBranchId() : int|null
Child classes should override for complex branch relationships.
Return values
int|null —The branch ID, or null if no association
isCompleted()
Check if the instance completed successfully.
public
isCompleted() : bool
Return values
boolisRunning()
Check if the instance is currently running.
public
isRunning() : bool
Return values
boolisTerminal()
Check if the instance has reached a terminal state.
public
isTerminal() : bool
Return values
boolisWaiting()
Check if the instance is waiting for external input.
public
isWaiting() : bool