The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Workflow::State - Information about an individual state in a workflow

SYNOPSIS

 # This is an internal object...

DESCRIPTION

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.

PUBLIC METHODS

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.

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.

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.

INTERNAL METHODS

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.

SEE ALSO

Workflow

Workflow::Factory

COPYRIGHT

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.

AUTHORS

Chris Winters <chris@cwinters.com>