Symbiote\AdvancedWorkflow\DataObjects\WorkflowInstance
A WorkflowInstance is created whenever a user 'starts' a workflow.
This 'start' is triggered automatically when the user clicks the relevant
button (eg 'apply for approval'). This creates a standalone object
that maintains the state of the workflow process.
- Author: marcus@symbiote.com.au
- License: BSD License (http://silverstripe.org/bsd-license/)
Synopsis
class WorkflowInstance
extends DataObject
{
- // members
- private static array $db = ;
- private static array $has_one = ;
- private static array $has_many = ;
- private static array $many_many = ;
- private static array $summary_fields = ;
- private static array $default_sort = ;
- private static boolean $hide_disabled_actions_on_frontend = false;
- private static array $diff_ignore_fields = ;
- private static string $table_name = 'WorkflowInstance';
- // methods
- public FieldList getCMSFields()
- public void fieldLabels()
- public void onBeforeWrite()
- public updateWorkflow()
- public null|DataObject getTarget()
- public null|DataObject Target()
- public ArrayList getTargetDiff()
- public void beginWorkflow()
- public void execute()
- protected WorkflowTransition checkTransitions()
- public void performTransition()
- public ArrayList getAssignedMembers()
- public boolean canView()
- public boolean canEdit()
- public boolean canDelete()
- protected void userHasAccess()
- public void canEditTarget()
- public boolean canViewTarget()
- public boolean canPublishTarget()
- public array validTransitions()
- public FieldList getWorkflowFields()
- public FieldList getFrontEndWorkflowFields()
- public FieldList getFrontEndWorkflowActions()
- public DataObject getFrontEndDataObject()
- public DataObject getFrontEndRequiredFields()
- public void setFrontendFormRequirements()
- public void doFrontEndAction()
- public boolean getVersionedConnection()
- public void getCurrentAction()
- public WorkflowAction|boolean getMostRecentActionForUser()
Hierarchy
Extends
- SilverStripe\ORM\DataObject
Tasks
Line | Task |
---|---|
215+ | refactor with AdvancedWorkflowExtension |
486+ | This could be made more efficient. |
Members
private
- $db
- $default_sort
-
$diff_ignore_fields
Fields to ignore when generating a diff for data objects. - $has_many
- $has_one
- $hide_disabled_actions_on_frontend
—
boolean
If set to true, actions that cannot be executed by the user will not show on the frontend (just like the backend). - $many_many
—
array
The list of users who are responsible for performing the current WorkflowAction - $summary_fields
- $table_name
Methods
protected
- checkTransitions() — Evaluate all the transitions of an action and determine whether we should follow any of them yet.
- userHasAccess() — Checks whether the given user is in the list of users assigned to this workflow
public
- Target()
- beginWorkflow() — Start a workflow based on a particular definition for a particular object.
- canDelete()
- canEdit()
- canEditTarget() — Can documents in the current workflow state be edited?
- canPublishTarget() — Does this action restrict the publishing of a document?
- canView()
- canViewTarget() — Does this action restrict viewing of the document?
- doFrontEndAction()
- execute() — Execute this workflow. In rare cases this will actually execute all actions, but typically, it will stop and wait for the user to input something
- fieldLabels()
- getAssignedMembers() — Returns a list of all Members that are assigned to this instance, either directly or via a group.
- getCMSFields() — Get the CMS view of the instance. This is used to display the log of this workflow, and options to reassign if the workflow hasn't been finished yet
- getCurrentAction() — Simple method to retrieve the current action, on the current WorkflowInstance
- getFrontEndDataObject() — Gets Front-End DataObject
- getFrontEndRequiredFields() — Gets Front-End DataObject
- getFrontEndWorkflowActions() — Gets Transitions for display as Front-End Form Actions
- getFrontEndWorkflowFields() — Gets Front-End form fields from current Action
- getMostRecentActionForUser() — Tells us if $member has had permissions over some part of the current WorkflowInstance.
- getTarget() — Get the target-object that this WorkflowInstance "points" to.
- getTargetDiff() — Returns the field differences between the older version and current version of Target
- getVersionedConnection() — We need a way to "associate" an author with this WorkflowInstance and its Target() to see if she is "allowed" to view WorkflowInstances within GridFields
- getWorkflowFields() — Gets fields for managing this workflow instance in its current step
- onBeforeWrite() — See if we've been saved in context of managing the workflow directly
- performTransition() — Transitions a workflow to the next step defined by the given transition.
- setFrontendFormRequirements()
- updateWorkflow() — Update the current state of the workflow
- validTransitions() — Get the current set of transitions that are valid for the current workflow state, and are available to the current user.