-
-
Notifications
You must be signed in to change notification settings - Fork 59
/
Copy pathWorkflowInterface.php
68 lines (56 loc) · 1.87 KB
/
WorkflowInterface.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Workflow;
use Symfony\Component\Workflow\Exception\LogicException;
use Symfony\Component\Workflow\Exception\UndefinedTransitionException;
use Symfony\Component\Workflow\MarkingStore\MarkingStoreInterface;
use Symfony\Component\Workflow\Metadata\MetadataStoreInterface;
/**
* Describes a workflow instance.
*
* @author Amrouche Hamza <[email protected]>
*
* @method Transition|null getEnabledTransition(object $subject, string $name)
*/
interface WorkflowInterface
{
/**
* Returns the object's Marking.
*
* @throws LogicException
*/
public function getMarking(object $subject): Marking;
/**
* Returns true if the transition is enabled.
*/
public function can(object $subject, string $transitionName): bool;
/**
* Builds a TransitionBlockerList to know why a transition is blocked.
*
* @throws UndefinedTransitionException If the transition is not defined
*/
public function buildTransitionBlockerList(object $subject, string $transitionName): TransitionBlockerList;
/**
* Fire a transition.
*
* @throws LogicException If the transition is not applicable
*/
public function apply(object $subject, string $transitionName, array $context = []): Marking;
/**
* Returns all enabled transitions.
*
* @return Transition[]
*/
public function getEnabledTransitions(object $subject): array;
public function getName(): string;
public function getDefinition(): Definition;
public function getMarkingStore(): MarkingStoreInterface;
public function getMetadataStore(): MetadataStoreInterface;
}