SeedDMS_Core_Workflow
in package
Class to represent an workflow in the document management system
Tags
Table of Contents
Properties
- $_dms : SeedDMS_Core_DMS
- $_id : int
- $_initstate : SeedDMS_Core_Workflow_State
- $_layoutdata : data
- $_name : string
- $_transitions : array<string|int, SeedDMS_Core_Workflow_Transition>
Methods
- __construct() : mixed
- SeedDMS_Core_Workflow constructor.
- addTransition() : SeedDMS_Core_Workflow_Transition|bool
- Add new transition to workflow
- checkForCycles() : bool
- Check if workflow contains cycles
- getID() : int
- getInitState() : SeedDMS_Core_Workflow_State
- getLayoutData() : string
- getName() : string
- getNextTransitions() : array<string|int, SeedDMS_Core_Workflow_Transition>|bool
- Get the transitions that can be triggered while being in the given state
- getPreviousTransitions() : array<string|int, SeedDMS_Core_Workflow_Transition>|bool
- Get the transitions that lead to the given state
- getStates() : array<string|int, mixed>
- Get all states this workflow at some point may reach
- getTransition() : bool|SeedDMS_Core_Workflow_Transition
- Get the transition by its id
- getTransitions() : array<string|int, SeedDMS_Core_Workflow_Transition>|bool
- getTransitionsByStates() : array<string|int, SeedDMS_Core_Workflow_Transition>|bool
- Get all transitions from one state into another state
- isUsed() : bool
- Check if workflow is currently used by any document
- remove() : bool
- Remove the workflow and all its transitions Do not remove actions and states of the workflow
- removeTransition() : bool
- Remove a transition from a workflow Deprecated! User SeedDMS_Core_Workflow_Transition::remove() instead.
- setDMS() : mixed
- setInitState() : bool
- setLayoutData() : mixed
- setName() : bool
- penetrate() : array<string|int, SeedDMS_Core_Workflow_State>|bool
Properties
$_dms
public
SeedDMS_Core_DMS
$_dms
reference to the dms instance this attribute belongs to
Tags
$_id
public
int
$_id
id of workflow
Tags
$_initstate
public
SeedDMS_Core_Workflow_State
$_initstate
initial state of the workflow
Tags
$_layoutdata
public
data
$_layoutdata
for rendering graph
Tags
$_name
public
string
$_name
name of the workflow
Tags
$_transitions
public
array<string|int, SeedDMS_Core_Workflow_Transition>
$_transitions
list of transitions
Tags
Methods
__construct()
SeedDMS_Core_Workflow constructor.
public
__construct(int $id, string $name, SeedDMS_Core_Workflow_State $initstate, string $layoutdata) : mixed
Parameters
- $id : int
- $name : string
- $initstate : SeedDMS_Core_Workflow_State
- $layoutdata : string
addTransition()
Add new transition to workflow
public
addTransition(SeedDMS_Core_Workflow_State $state, SeedDMS_Core_Workflow_Action $action, SeedDMS_Core_Workflow_State $nextstate, array<string|int, SeedDMS_Core_User> $users, array<string|int, SeedDMS_Core_Group> $groups) : SeedDMS_Core_Workflow_Transition|bool
Parameters
- $state : SeedDMS_Core_Workflow_State
- $action : SeedDMS_Core_Workflow_Action
- $nextstate : SeedDMS_Core_Workflow_State
- $users : array<string|int, SeedDMS_Core_User>
- $groups : array<string|int, SeedDMS_Core_Group>
Return values
SeedDMS_Core_Workflow_Transition|bool —instance of new transition
checkForCycles()
Check if workflow contains cycles
public
checkForCycles() : bool
Return values
bool —list of states if workflow contains cycles, otherwise false
getID()
public
getID() : int
Return values
intgetInitState()
public
getInitState() : SeedDMS_Core_Workflow_State
Return values
SeedDMS_Core_Workflow_StategetLayoutData()
public
getLayoutData() : string
Return values
stringgetName()
public
getName() : string
Return values
stringgetNextTransitions()
Get the transitions that can be triggered while being in the given state
public
getNextTransitions(SeedDMS_Core_Workflow_State $state) : array<string|int, SeedDMS_Core_Workflow_Transition>|bool
Parameters
- $state : SeedDMS_Core_Workflow_State
-
current workflow state
Return values
array<string|int, SeedDMS_Core_Workflow_Transition>|boolgetPreviousTransitions()
Get the transitions that lead to the given state
public
getPreviousTransitions(SeedDMS_Core_Workflow_State $state) : array<string|int, SeedDMS_Core_Workflow_Transition>|bool
Parameters
- $state : SeedDMS_Core_Workflow_State
-
current workflow state
Return values
array<string|int, SeedDMS_Core_Workflow_Transition>|boolgetStates()
Get all states this workflow at some point may reach
public
getStates() : array<string|int, mixed>
It basically iterates through all transistions and makes a unique list of the start and end state.
Return values
array<string|int, mixed> —list of states
getTransition()
Get the transition by its id
public
getTransition(int $id) : bool|SeedDMS_Core_Workflow_Transition
Parameters
- $id : int
-
id of transition
Return values
bool|SeedDMS_Core_Workflow_TransitiongetTransitions()
public
getTransitions() : array<string|int, SeedDMS_Core_Workflow_Transition>|bool
Return values
array<string|int, SeedDMS_Core_Workflow_Transition>|boolgetTransitionsByStates()
Get all transitions from one state into another state
public
getTransitionsByStates(SeedDMS_Core_Workflow_State $state, SeedDMS_Core_Workflow_State $nextstate) : array<string|int, SeedDMS_Core_Workflow_Transition>|bool
Parameters
- $state : SeedDMS_Core_Workflow_State
-
state to start from
- $nextstate : SeedDMS_Core_Workflow_State
-
state after transition
Return values
array<string|int, SeedDMS_Core_Workflow_Transition>|boolisUsed()
Check if workflow is currently used by any document
public
isUsed() : bool
Return values
bool —true if workflow is used, otherwise false
remove()
Remove the workflow and all its transitions Do not remove actions and states of the workflow
public
remove() : bool
Return values
bool —true on success or false in case of an error false is also returned if the workflow is currently in use
removeTransition()
Remove a transition from a workflow Deprecated! User SeedDMS_Core_Workflow_Transition::remove() instead.
public
removeTransition(SeedDMS_Core_Workflow_Transition $transition) : bool
Parameters
- $transition : SeedDMS_Core_Workflow_Transition
Return values
bool —true if no error occured, otherwise false
setDMS()
public
setDMS(SeedDMS_Core_DMS $dms) : mixed
Parameters
- $dms : SeedDMS_Core_DMS
setInitState()
public
setInitState(SeedDMS_Core_Workflow_State $state) : bool
Parameters
- $state : SeedDMS_Core_Workflow_State
Return values
boolsetLayoutData()
public
setLayoutData(mixed $newdata) : mixed
Parameters
- $newdata : mixed
setName()
public
setName( $newName) : bool
Parameters
Return values
boolpenetrate()
private
penetrate(array<string|int, SeedDMS_Core_Workflow_State> $laststates) : array<string|int, SeedDMS_Core_Workflow_State>|bool
Parameters
- $laststates : array<string|int, SeedDMS_Core_Workflow_State>