Menu

## SeedDMS_Core_Workflow
in package

inc.ClassWorkflow.php : 25

Class to represent an workflow in the document management system

##### Tags

category

  DMS

author

  Markus Westphal, Malcolm Cowe, Uwe Steinmann uwe@steinmann.cx

copyright

  Copyright (C) 2012-2024 Uwe Steinmann

version

  Release: @package_version@

### Table of Contents

#### Properties

$_dms : SeedDMS_Core_DMS
$_id : int
$_initstate : SeedDMS_Core_Workflow_State
$_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
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
setName() : bool
penetrate() : array<string|int, SeedDMS_Core_Workflow_State>|bool

### Properties

#### $_dms

inc.ClassWorkflow.php : 59
`protected SeedDMS_Core_DMS $_dms`

reference to the dms instance this attribute belongs to

##### Tags

access

  protected

#### $_id

inc.ClassWorkflow.php : 31
`protected int $_id`

id of workflow

##### Tags

access

  protected

#### $_initstate

inc.ClassWorkflow.php : 45
`protected SeedDMS_Core_Workflow_State $_initstate`

initial state of the workflow

##### Tags

access

  protected

#### $_name

inc.ClassWorkflow.php : 38
`protected string $_name`

name of the workflow

##### Tags

access

  protected

#### $_transitions

inc.ClassWorkflow.php : 52
`protected array<string|int, SeedDMS_Core_Workflow_Transition> $_transitions`

name of the workflow state

##### Tags

access

  protected

### Methods

#### __construct()

inc.ClassWorkflow.php : 67

SeedDMS_Core_Workflow constructor.

`public __construct(int $id, string $name, SeedDMS_Core_Workflow_State $initstate) : mixed`

##### Parameters

$id : int
$name : string
$initstate : SeedDMS_Core_Workflow_State

#### addTransition()

inc.ClassWorkflow.php : 312

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()

inc.ClassWorkflow.php : 391

Check if workflow contains cycles

`public checkForCycles() : bool`

##### Return values

bool —

list of states if workflow contains cycles, otherwise false

#### getID()

inc.ClassWorkflow.php : 85
`public getID() : int`

##### Return values

int

#### getInitState()

inc.ClassWorkflow.php : 114
`public getInitState() : SeedDMS_Core_Workflow_State`

##### Return values

SeedDMS_Core_Workflow_State

#### getName()

inc.ClassWorkflow.php : 92
`public getName() : string`

##### Return values

string

#### getNextTransitions()

inc.ClassWorkflow.php : 217

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>|bool

#### getPreviousTransitions()

inc.ClassWorkflow.php : 246

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>|bool

#### getStates()

inc.ClassWorkflow.php : 169

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()

inc.ClassWorkflow.php : 196

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_Transition

#### getTransitions()

inc.ClassWorkflow.php : 136
`public getTransitions() : array<string|int, SeedDMS_Core_Workflow_Transition>|bool`

##### Return values

array<string|int, SeedDMS_Core_Workflow_Transition>|bool

#### getTransitionsByStates()

inc.ClassWorkflow.php : 272

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>|bool

#### isUsed()

inc.ClassWorkflow.php : 353

Check if workflow is currently used by any document

`public isUsed() : bool`

##### Return values

bool —

true if workflow is used, otherwise false

#### remove()

inc.ClassWorkflow.php : 407

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()

inc.ClassWorkflow.php : 298

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()

inc.ClassWorkflow.php : 78
`public setDMS(SeedDMS_Core_DMS $dms) : mixed`

##### Parameters

$dms : SeedDMS_Core_DMS

#### setInitState()

inc.ClassWorkflow.php : 120
`public setInitState(SeedDMS_Core_Workflow_State $state) : bool`

##### Parameters

$state : SeedDMS_Core_Workflow_State

##### Return values

bool

#### setName()

inc.ClassWorkflow.php : 98
`public setName( $newName) : bool`

##### Parameters

$newName :

##### Return values

bool

#### penetrate()

inc.ClassWorkflow.php : 368
`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>

##### Return values

array<string|int, SeedDMS_Core_Workflow_State>|bool

## Search results