class Workflow implements WorkflowInterface

Methods

__construct(Definition $definition, MarkingStoreInterface $markingStore = null, EventDispatcherInterface $dispatcher = null, string $name = 'unnamed')

No description

getMarking(object $subject)

Returns the object's Marking.

bool
can(object $subject, string $transitionName)

Returns true if the transition is enabled.

buildTransitionBlockerList($subject, string $transitionName)

Builds a TransitionBlockerList to know why a transition is blocked.

apply($subject, $transitionName, array $context = [])

Fire a transition.

getEnabledTransitions(object $subject)

Returns all enabled transitions.

string
getName()

No description

getDefinition()

No description

Details

at line 42
__construct(Definition $definition, MarkingStoreInterface $markingStore = null, EventDispatcherInterface $dispatcher = null, string $name = 'unnamed')

Parameters

Definition $definition
MarkingStoreInterface $markingStore
EventDispatcherInterface $dispatcher
string $name

at line 53
Marking getMarking(object $subject)

Returns the object's Marking.

Parameters

object $subject A subject

Return Value

Marking The Marking

Exceptions

LogicException

at line 95
bool can(object $subject, string $transitionName)

Returns true if the transition is enabled.

Parameters

object $subject A subject
string $transitionName A transition

Return Value

bool true if the transition is enabled

at line 118
TransitionBlockerList buildTransitionBlockerList($subject, string $transitionName)

Builds a TransitionBlockerList to know why a transition is blocked.

Parameters

$subject
string $transitionName

Return Value

TransitionBlockerList

at line 154
Marking apply($subject, $transitionName, array $context = [])

Fire a transition.

Parameters

$subject
$transitionName
array $context

Return Value

Marking The new Marking

Exceptions

LogicException If the transition is not applicable

at line 206
Transition[] getEnabledTransitions(object $subject)

Returns all enabled transitions.

Parameters

object $subject A subject

Return Value

Transition[] All enabled transitions

at line 224
string getName()

Return Value

string

at line 232
Definition getDefinition()

Return Value

Definition

at line 240
MarkingStoreInterface getMarkingStore()

Return Value

MarkingStoreInterface

at line 248
MetadataStoreInterface getMetadataStore()

Return Value

MetadataStoreInterface