Symbiote\AdvancedWorkflow\DataObjects\WorkflowDefinition
An overall definition of a workflow
The workflow definition has a series of steps to it. Each step has a series of possible transitions
that it can take - the first one that meets certain criteria is followed, which could lead to
another step.
A step is either manual or automatic; an example 'manual' step would be requiring a person to review
a document. An automatic step might be to email a group of people, or to publish documents.
Basically, a manual step requires the interaction of someone to pick which action to take, an automatic
step will automatically determine what to do once it has finished.
- Author: marcus@symbiote.com.au
- License: BSD License (http://silverstripe.org/bsd-license/)
Synopsis
class WorkflowDefinition
extends DataObject
{
- // members
- private static array $db = ;
- private static string $default_sort = 'Sort';
- private static array $has_many = ;
- private static array $many_many = ;
- private static string $icon = 'symbiote/silverstripe-advancedworkflow:images/definition.png';
- public static string $default_workflow_title_base = 'My Workflow';
- public static array $workflow_defs = ;
- private static array $dependencies = ;
- private static string $table_name = 'WorkflowDefinition';
- public WorkflowService $workflowService;
- // methods
- public WorkflowAction getInitialAction()
- public void onBeforeWrite()
- public void onAfterWrite()
- public null onBeforeDelete()
- private void removeRelatedHasLists()
- private void deleteRelatedImport()
- public int numChildren()
- public void fieldLabels()
- public void getCMSFields()
- public void updateAdminActions()
- public void updateFromTemplate()
- public string getDefaultWorkflowTitle()
- public string incomingTitle()
- public Boolean canWorkflowPublish()
- public bool canCreate()
- public boolean canView()
- public boolean canEdit()
- public boolean canDelete()
- protected bool userHasAccess()
- public $this setWorkflowService()
- public WorkflowService getWorkflowService()
Hierarchy
Extends
- SilverStripe\ORM\DataObject
Tasks
Line | Task |
---|---|
425+ | Filter query on current-user's workflows. Avoids confusion when other users may already have 'My Workflow 1' and user sees 'My Workflow 2' |
Members
private
- $db
- $default_sort
- $dependencies
- $has_many
- $icon
- $many_many
—
array
By default, a workflow definition is bound to a particular set of users or groups. - $table_name
public
- $default_workflow_title_base
- $workflowService — Symbiote\AdvancedWorkflow\Services\WorkflowService
- $workflow_defs
Methods
private
- deleteRelatedImport() — Deletes related ImportedWorkflowTemplate objects.
- removeRelatedHasLists() — Removes User+Group relations from this object as well as WorkflowAction relations.
protected
- userHasAccess() — Checks whether the passed user is able to view this ModelAdmin
public
- canCreate()
- canDelete()
- canEdit()
- canView()
- canWorkflowPublish() — Determines if target can be published directly when no workflow has started yet Opens extension hook to allow an extension to determine if this is allowed as well
- fieldLabels()
- getCMSFields()
- getDefaultWorkflowTitle() — If a workflow-title doesn't already exist, we automatically create a suitable default title when users attempt to create title-less workflow definitions or upload/create Workflows that would otherwise have the same name.
- getInitialAction() — Gets the action that first triggers off the workflow
- getWorkflowService()
- incomingTitle() — Return the workflow definition title according to the source
- numChildren()
- onAfterWrite() — After we've been written, check whether we've got a template and to then create the relevant actions etc.
- onBeforeDelete() — Ensure all WorkflowDefinition relations are removed on delete. If we don't do this, we see issues with targets previously under the control of a now-deleted workflow, becoming stuck, even if a new workflow is subsequently assigned to it.
- onBeforeWrite() — Ensure a sort value is set and we get a useable initial workflow title.
- setWorkflowService()
- updateAdminActions()
- updateFromTemplate()