WorkflowTypeInterface
interface WorkflowTypeInterface implements PluginWithFormsInterface, DerivativeInspectionInterface, ConfigurableInterface, DependentPluginInterface (View source)
An interface for Workflow type plugins.
Constants
| PLUGIN_FORM_KEY |
The key of the global workflow plugin form. |
Methods
Gets the definition of the plugin implementation.
Gets the form class for the given operation.
Gets whether the plugin has a form class for the given operation.
Gets the base_plugin_id of the plugin instance.
Gets the derivative_id of the plugin instance.
Sets the configuration for this plugin instance.
Calculates dependencies for the configured plugin.
Gets the label for the workflow type.
Determines if the workflow is being has data associated with it.
Determines if the workflow state has data associated with it.
Gets the initial state for the workflow.
Gets the required states of workflow type.
Informs the plugin that a dependency of the workflow will be deleted.
Adds a state to the workflow.
Determines if the workflow has a state with the provided ID.
Gets state objects for the provided state IDs.
Gets a workflow state.
Sets a state's label.
Sets a state's weight value.
Deletes a state from the workflow.
Adds a transition to the workflow.
Gets a transition object for the provided transition ID.
Determines if a transition exists.
Gets transition objects for the provided transition IDs.
Gets the transition IDs for a state for the provided direction.
Gets a transition from state to state.
Determines if a transition from state to state exists.
Sets a transition's label.
Sets a transition's weight.
Sets a transition's from states.
Deletes a transition.
Details
string
getPluginId()
Gets the plugin_id of the plugin instance.
array
getPluginDefinition()
Gets the definition of the plugin implementation.
string|null
getFormClass(string $operation)
Gets the form class for the given operation.
bool
hasFormClass(string $operation)
Gets whether the plugin has a form class for the given operation.
string
getBaseId()
Gets the base_plugin_id of the plugin instance.
string|null
getDerivativeId()
Gets the derivative_id of the plugin instance.
array
getConfiguration()
Gets this plugin's configuration.
setConfiguration(array $configuration)
Sets the configuration for this plugin instance.
array
defaultConfiguration()
Gets default configuration for this plugin.
array
calculateDependencies()
Calculates dependencies for the configured plugin.
Dependencies are saved in the plugin's configuration entity and are used to determine configuration synchronization order. For example, if the plugin integrates with specific user roles, this method should return an array of dependencies listing the specified roles.
string
label()
Gets the label for the workflow type.
bool
workflowHasData(WorkflowInterface $workflow)
| internal | Marked as internal until it's validated this should form part of the public API in https://www.drupal.org/node/2897148. |
Determines if the workflow is being has data associated with it.
bool
workflowStateHasData(WorkflowInterface $workflow, StateInterface $state)
| internal | Marked as internal until it's validated this should form part of the public API in https://www.drupal.org/node/2897148. |
Determines if the workflow state has data associated with it.
StateInterface
getInitialState()
Gets the initial state for the workflow.
string[]
getRequiredStates()
Gets the required states of workflow type.
This is usually specified in the workflow type annotation.
bool
onDependencyRemoval(array $dependencies)
Informs the plugin that a dependency of the workflow will be deleted.
$this
addState(string $state_id, string $label)
Adds a state to the workflow.
bool
hasState(string $state_id)
Determines if the workflow has a state with the provided ID.
StateInterface[]
getStates(string[] $state_ids = NULL)
Gets state objects for the provided state IDs.
StateInterface
getState(string $state_id)
Gets a workflow state.
$this
setStateLabel(string $state_id, string $label)
Sets a state's label.
$this
setStateWeight(string $state_id, int $weight)
Sets a state's weight value.
$this
deleteState(string $state_id)
Deletes a state from the workflow.
$this
addTransition(string $id, string $label, array $from_state_ids, string $to_state_id)
Adds a transition to the workflow.
TransitionInterface
getTransition(string $transition_id)
Gets a transition object for the provided transition ID.
bool
hasTransition(string $transition_id)
Determines if a transition exists.
TransitionInterface[]
getTransitions(array $transition_ids = NULL)
Gets transition objects for the provided transition IDs.
array
getTransitionsForState($state_id, string $direction = TransitionInterface::DIRECTION_FROM)
Gets the transition IDs for a state for the provided direction.
TransitionInterface
getTransitionFromStateToState(string $from_state_id, string $to_state_id)
Gets a transition from state to state.
bool
hasTransitionFromStateToState(string $from_state_id, string $to_state_id)
Determines if a transition from state to state exists.
$this
setTransitionLabel(string $transition_id, string $label)
Sets a transition's label.
$this
setTransitionWeight(string $transition_id, int $weight)
Sets a transition's weight.
$this
setTransitionFromStates(string $transition_id, array $from_state_ids)
Sets a transition's from states.
$this
deleteTransition(string $transition_id)
Deletes a transition.