|
1
|
|
|
<?php |
|
2
|
|
|
/** |
|
3
|
|
|
* @link https://github.com/old-town/old-town-workflow |
|
4
|
|
|
* @author Malofeykin Andrey <[email protected]> |
|
5
|
|
|
*/ |
|
6
|
|
|
namespace OldTown\Workflow; |
|
7
|
|
|
|
|
8
|
|
|
use OldTown\Workflow\Config\ConfigurationInterface; |
|
9
|
|
|
use OldTown\Workflow\Exception\FactoryException; |
|
10
|
|
|
use OldTown\Workflow\Exception\InvalidArgumentException; |
|
11
|
|
|
use OldTown\Workflow\Loader\WorkflowDescriptor; |
|
12
|
|
|
|
|
13
|
|
|
/** |
|
14
|
|
|
* Interface WorkflowInternalInterface |
|
15
|
|
|
* |
|
16
|
|
|
* @package OldTown\Workflow |
|
17
|
|
|
*/ |
|
18
|
|
|
interface WorkflowInternalInterface extends WorkflowInterface |
|
19
|
|
|
{ |
|
20
|
|
|
/** |
|
21
|
|
|
* Get the available actions for the specified workflow instance. |
|
22
|
|
|
* @param integer $id The workflow instance id. |
|
23
|
|
|
* @param array $inputs The inputs map to pass on to conditions |
|
24
|
|
|
* @return [] |
|
|
|
|
|
|
25
|
|
|
* @throws InvalidArgumentException if the specified id does not exist, or if its workflow |
|
26
|
|
|
* descriptor is no longer available or has become invalid. |
|
27
|
|
|
*/ |
|
28
|
|
|
public function getAvailableActions($id, array $inputs = []); |
|
29
|
|
|
|
|
30
|
|
|
/** |
|
31
|
|
|
* Set the configuration for this workflow. |
|
32
|
|
|
* If not set, then the workflow will use the default configuration static instance. |
|
33
|
|
|
* @param ConfigurationInterface $configuration a workflow configuration |
|
34
|
|
|
* @return $this |
|
35
|
|
|
*/ |
|
36
|
|
|
public function setConfiguration(ConfigurationInterface $configuration); |
|
37
|
|
|
|
|
38
|
|
|
/** |
|
39
|
|
|
* Get all available workflow names. |
|
40
|
|
|
* |
|
41
|
|
|
* @return String[] |
|
42
|
|
|
*/ |
|
43
|
|
|
public function getWorkflowNames(); |
|
44
|
|
|
|
|
45
|
|
|
/** |
|
46
|
|
|
* Determine if a particular workflow can be initialized. |
|
47
|
|
|
* @param string $workflowName The workflow name to check. |
|
48
|
|
|
* @param integer $initialAction The potential initial action. |
|
49
|
|
|
* @param array $inputs The inputs to check. |
|
50
|
|
|
* @return boolean true if the workflow can be initialized, false otherwise. |
|
51
|
|
|
*/ |
|
52
|
|
|
//public function canInitialize($workflowName, $initialAction, array $inputs = []); |
|
|
|
|
|
|
53
|
|
|
|
|
54
|
|
|
/** |
|
55
|
|
|
* Remove the specified workflow descriptor. |
|
56
|
|
|
* @param string $workflowName The workflow name of the workflow to remove. |
|
57
|
|
|
* @return boolean true if the workflow was removed, false otherwise. |
|
58
|
|
|
* @throws FactoryException If the underlying workflow factory has an error removing the workflow, |
|
59
|
|
|
* or if it does not support the removal of workflows. |
|
60
|
|
|
*/ |
|
61
|
|
|
public function removeWorkflowDescriptor($workflowName); |
|
62
|
|
|
|
|
63
|
|
|
/** |
|
64
|
|
|
* Add a new workflow descriptor |
|
65
|
|
|
* @param string $workflowName The workflow name of the workflow to add |
|
66
|
|
|
* @param WorkflowDescriptor $descriptor The workflow descriptor to add |
|
67
|
|
|
* @param boolean $replace true, if an existing descriptor should be overwritten |
|
68
|
|
|
* @return boolean true if the workflow was added, fales otherwise |
|
69
|
|
|
* @throws FactoryException If the underlying workflow factory has an error adding the workflow, |
|
70
|
|
|
* or if it does not support adding workflows. |
|
71
|
|
|
*/ |
|
72
|
|
|
public function saveWorkflowDescriptor($workflowName, WorkflowDescriptor $descriptor, $replace); |
|
73
|
|
|
} |
|
74
|
|
|
|
This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.