Workflow::State - Information about an individual state in a workflow
# This is an internal object...
Each Workflow::State object represents a state in a workflow. Each state can report its name, description and all available actions. Given the name of an action it can also report what conditions are attached to the action and what state will result from the action.
get_conditions( $action_name )
Returns a list of Condition objects for action $action_name. Throws exception if object does not contain $action_name at all.
$action_name
contains_action( $action_name )
Returns true if this state contains action $action_name, false if not.
is_action_available( $workflow, $action_name )
Returns true if $action_name is contained within this state and it matches any conditions attached to it, using the data in the context of the $workflow to do the checks.
$workflow
evaluate_action( $workflow, $action_name )
Throws exception if action $action_name is either not contained in this state or if it does not pass any of the attached conditions, using the data in the context of $workflow to do the checks.
get_all_action_names()
Returns list of all action names available in this state.
get_available_action_names( $workflow )
Returns all actions names that are available given the data in $workflow. Each action name returned will return true from is_action_available().
get_next_state( $action_name )
Returns the state that will result if action $action_name executed.
init( $config )
Assigns 'state' and 'description' properties from $config. Also assigns configuration for all actions in the state, performing some sanity checks like ensuring every action has a 'resulting_state' key.
$config
Workflow
Workflow::Factory
Copyright (c) 2003-2004 Chris Winters. All rights reserved.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Chris Winters <chris@cwinters.com>
To install Workflow, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Workflow
CPAN shell
perl -MCPAN -e shell install Workflow
For more information on module installation, please visit the detailed CPAN module installation guide.