Symbiote\AdvancedWorkflow\Templates\WorkflowTemplate
A class that wraps around an array description of a workflow
array(
'Step Name' = array(
'type' => class name
'transitions' => array(
'transition name' => 'target step',
'next name' => 'other step'
)
),
'Next Step' = array(
),
)
This can be defined in config yml as follows
SilverStripe\Core\Injector\Injector:
SimpleReviewApprove:
class: Symbiote\AdvancedWorkflow\Templates\WorkflowTemplate
constructor:
- Review and Approve
- Description of the workflow template
- 0.1 (version number)
properties:
structure:
Apply for approval:
type: AssignUsersToWorkflowAction
transitions:
notify: Notify users
Notify users:
type: NotifyUsersWorkflowAction
transitions:
approval: Approval
Approval:
type: SimpleApprovalWorkflowAction
transitions:
Approve: Publish
Reject: Reject
Publish:
type: PublishItemWorkflowAction
Reject:
type: CancelWorkflowAction
Symbiote\AdvancedWorkflow\Services\WorkflowService:
properties:
templates:
- %$SimpleReviewApprove
When updating a template, there's a few things that can be done to assist
the system when changing things around
1. Update the 'version' number
- Author: marcus@symbiote.com.au
- License: BSD License http://silverstripe.org/bsd-license/
Synopsis
- // members
- protected $name;
- protected $description;
- protected $version;
- protected $remindDays;
- protected $sort;
- protected $structure;
- // methods
- public void __construct()
- public void getName()
- public void getVersion()
- public void getDescription()
- public void getRemindDays()
- public void getSort()
- public void setStructure()
- public array createRelations()
- protected WorkflowAction createAction()
- protected void createUsers()
- protected void createGroups()
- protected array updateActionTransitions()
- public void updateDefinition()
- protected void addManyManyToObject()
Members
protected
- $description
- $name
- $remindDays
- $sort
- $structure
—
array
An array representation of the structure of this workflow template - $version
Methods
protected
- addManyManyToObject() — Given an object, first check it has a ManyMany relation on it and add() Member and Group relations as required.
- createAction() — Create a workflow action based on a template
- createGroups() — Create a WorkflowDefinition->Groups relation based on template data, But only if the related groups from the export, can be foud in the target environment's DB.
- createUsers() — Create a WorkflowDefinition->Users relation based on template data. But only if the related groups from the export, can be foud in the target environment's DB.
- updateActionTransitions() — Update the transitions for a given action
public
- __construct()
- createRelations() — Creates the relevant data objects for this structure, returning an array of actions in the order they've been created
- getDescription()
- getName()
- getRemindDays()
- getSort()
- getVersion()
- setStructure() — Set the structure for this template
- updateDefinition() — Update a workflow definition