Symbiote\AdvancedWorkflow\DataObjects\WorkflowAction
A workflow action describes a the 'state' a workflow can be in, and the action(s) that occur while in that state. An action can then have subsequent transitions out of the current state.
- Author: marcus@symbiote.com.au
- License: BSD License (http://silverstripe.org/bsd-license/)
Synopsis
class WorkflowAction
extends DataObject
{
- // members
- private static array $db = ;
- private static array $defaults = ;
- private static string $default_sort = 'Sort';
- private static array $has_one = ;
- private static array $has_many = ;
- private static string $instance_class = WorkflowActionInstance::class;
- private static string $icon = 'symbiote/silverstripe-advancedworkflow:images/action.png';
- private static string $table_name = 'WorkflowAction';
- // methods
- public bool canEditTarget()
- public bool canViewTarget()
- public bool canPublishTarget()
- public bool canCreate()
- public bool canEdit()
- public bool canDelete()
- public void canAddTransition()
- public WorkflowActionInstance getInstanceForWorkflow()
- public bool execute()
- public void onBeforeWrite()
- public void onAfterDelete()
- public void targetUpdated()
- public void numChildren()
- public void getCMSFields()
- public void getValidator()
- public void summaryFields()
- public void fieldLabels()
- public void updateFrontendWorkflowFields()
- public void Icon()
Hierarchy
Extends
- SilverStripe\ORM\DataObject
Members
private
- $db
- $default_sort
- $defaults
- $has_many
- $has_one
- $icon
- $instance_class
—
string
The type of class to use for instances of this workflow action that are used for storing the data of the instance. - $table_name
Methods
public
- Icon()
- canAddTransition()
- canCreate() — Allows users who have permission to create a WorkflowDefinition, to create actions on it too.
- canDelete()
- canEdit()
- canEditTarget() — Can documents in the current workflow state be edited?
- canPublishTarget() — Does this action restrict the publishing of a document?
- canViewTarget() — Does this action restrict viewing of the document?
- execute() — Perform whatever needs to be done for this action. If this action can be considered executed, then return true - if not (ie it needs some user input first), return false and 'execute' will be triggered again at a later point in time after the user has provided more data, either directly or indirectly.
- fieldLabels()
- getCMSFields()
- getInstanceForWorkflow() — Gets an object that is used for saving the actual state of things during a running workflow. It still uses the workflow action def for managing the functional execution, however if you need to store additional data for the state, you can specify your own WorkflowActionInstance instead of the default to capture these elements
- getValidator()
- numChildren()
- onAfterDelete() — When deleting an action from a workflow definition, make sure that workflows currently paused on that action are deleted Also removes all outbound transitions
- onBeforeWrite()
- summaryFields()
- targetUpdated() — Called when the current target of the workflow has been updated
- updateFrontendWorkflowFields() — Used for Front End Workflows