Bric::Biz::Workflow(3p)

NAME
Bric::Biz::Workflow - Controls the progress of an asset through a series of desks.

VERSION
$LastChangedRevision$

DATE
$LastChangedDate: 2005-08-19 20:54:48 +0200 (Fri, 19 Aug 2005) $

SYNOPSIS
  my $flow = new Bric::Biz::Workflow($param);

  $id    = $flow->get_id;

  $name  = $flow->get_name;
  $flow  = $flow->set_name($name);

  $site_id = $flow->get_site_id;
  $flow    = $flow->set_site_id($site_id);

  $desc  = $flow->get_description;
  $flow  = $flow->set_description($desc);

  $flow  = $flow->add_desk($param);

  # Returns a list of allowed desks.
  @desks = $flow->allowed_desks();

  # Lists the required desks
  @desks = $flow->required_desks();

DESCRIPTION
A workflow is something that guides an asset through a set of desks, where an asset is any kind of creative content (a story, an image, a sound file, etc) and a desk performs and kind of validation or transformation upon an asset needed before it can be published. Example desks might be a 'legal' desk where users can verify any legal issue for a particular asset, or an 'edit' desk where users can check consistancy and presentation for an asset.

A workflow might be as simple as a linear path through a set of desks or as complex as requiring certain desks be visited with other desks optional and a route through the desks that can be arbitrarily complex.

INTERFACE

  Constructors

$success = $obj = new Bric::Biz::Workflow($param);
    Keys for $param are:

    *   name

        The name for this workflow

    *   site_id

        The site this workflow belongs to

    *   description

        A description for this workflow

    *   start_desk

        The starting desk for this workflow

    Throws:

    NONE

    Side Effects:

    NONE

    Notes:

    NONE

my $wf = Bric::Biz::Workflow->lookup({ id => $id });
my $wf = Bric::Biz::Workflow->lookup({ name => $name });
    Looks up and instantiates a new Bric::Biz::Workflow object based on an Bric::Biz::Workflow object ID or name. If no output channelobject is found in the database, "lookup()" returns "undef".

    Throws:

    *   Unable to prepare SQL statement.

    *   Unable to connect to database.

    *   Unable to select column into arrayref.

    *   Unable to execute SQL statement.

    *   Unable to bind to columns to statement handle.

    *   Unable to fetch row from statement handle.

    Side Effects: NONE.

    Notes: NONE.

(@all || $all) = Bric::Biz::Workflow->list($params);
    Return a list of all known workflow types. Keys of the $params hash reference are:

    "id"
        Workflow ID. May use "ANY" for a list of possible values.

    "name"
        Return all workflows matching a certain name. May use "ANY" for a list of possible values.

    "site_id"
        Return all workflows matching a certain site id. May use "ANY" for a list of possible values.

    "description"
        Return all workflows with a matching description. May use "ANY" for a list of possible values.

    "description"
        Return all workflows with a matching description. May use "ANY" for a list of possible values.

    "active"
        Boolean; Return all in/active workflows.

    "type"
        Return all workflows of a particular type. The types are integers accessible via the "STORY_WORKFLOW", "MEDIA_WORKFLOW", and "TEMPLATE_WORKFLOW" constants. May use "ANY" for a list of possible values.

    <desk_id>
        Return all workflows containing a desk with this desk ID. May use "ANY" for a list of possible values.

    "grp_id"
        Return all workflows in the group corresponding to this group ID. May use "ANY" for a list of possible values.

    Throws:

    *   Unable to prepare SQL statement.

    *   Unable to connect to database.

    *   Unable to select column into arrayref.

    *   Unable to execute SQL statement.

    *   Unable to bind to columns to statement handle.

    *   Unable to fetch row from statement handle.

    Side Effects: NONE.

    Notes: Seaches against "name" and "description" use the LIKE operator, so '%' can be used for substring searching.

(@ids || $ids) = Bric::Biz::Workflow->list_ids($params);
    Return a list of workflow IDs. See "list()" for a list of the relevant keys in the $params hash reference.

    Throws:

    *   Unable to prepare SQL statement.

    *   Unable to connect to database.

    *   Unable to select column into arrayref.

    *   Unable to execute SQL statement.

    *   Unable to bind to columns to statement handle.

    *   Unable to fetch row from statement handle.

    Side Effects: NONE.

    Notes: Seaches against "name" and "description" use the LIKE operator, so '%' can be used for substring searching.

  Destructors

$self->DESTROY
    Dummy method to prevent wasting time trying to AUTOLOAD DESTROY.

  Public Class Methods

my $meths = Bric::Biz::Workflow->my_meths
my (@meths || $meths_aref) = Bric::Biz::Workflow->my_meths(TRUE)
my (@meths || $meths_aref) = Bric::Biz::Workflow->my_meths(0, TRUE)
    Returns an anonymous hash of introspection data for this object. If called with a true argument, it will return an ordered list or anonymous array of introspection data. If a second true argument is passed instead of a first, then a list or anonymous array of introspection data will be returned for properties that uniquely identify an object (excluding "id", which is assumed).

    Each hash key is the name of a property or attribute of the object. The value for a hash key is another anonymous hash containing the following keys:

    name
        The name of the property or attribute. Is the same as the hash key when an anonymous hash is returned.

    disp
        The display name of the property or attribute.

    get_meth
        A reference to the method that will retrieve the value of the property or attribute.

    get_args
        An anonymous array of arguments to pass to a call to get_meth in order to retrieve the value of the property or attribute.

    set_meth
        A reference to the method that will set the value of the property or attribute.

    set_args
        An anonymous array of arguments to pass to a call to set_meth in order to set the value of the property or attribute.

    type
        The type of value the property or attribute contains. There are only three types:

        short
        date
        blob
    len If the value is a 'short' value, this hash key contains the length of the field.

    search
        The property is searchable via the list() and list_ids() methods.

    req The property or attribute is required.

    props
        An anonymous hash of properties used to display the property or attribute. Possible keys include:

        type
            The display field type. Possible values are

            text
            textarea
            password
            hidden
            radio
            checkbox
            select
        length
            The Length, in letters, to display a text or password field.

        maxlength
            The maximum length of the property or value - usually defined by the SQL DDL.

    rows
        The number of rows to format in a textarea field.

    cols
        The number of columns to format in a textarea field.

    vals
        An anonymous hash of key/value pairs reprsenting the values and display names to use in a select list.

    Throws: NONE.

    Side Effects: NONE.

    Notes: NONE.

  Public Instance Methods

$id = $workflow->get_id
    Returns the workflow's ID.

    Throws: NONE.

    Side Effects: NONE.

    Notes: NONE.

$site_id = $workflow->get_site_id
    Returns the ID of the site this Workflow is a part of

    Throws: NONE.

    Side Effects: NONE.

    Notes: NONE.

$workflow = $workflow->set_site_id($site_id)
    Set the ID of the site this Workflow should be a part of

    Throws: NONE.

    Side Effects: NONE.

    Notes: NONE.

$flow->add_desk($param);
    Add a desk to this workflow. Keys to param are:

    *   allowed

        Add a list of desks as part of the allowed desks.

    *   required

        Add a list of desks as required desks.

    Throws:

    NONE

    Side Effects:

    NONE

    Notes:

    NONE

$flow->del_desk([$desk || $desk_id]);
    Delete a desk from this workflow.

    Throws:

    NONE

    Side Effects:

    NONE

    Notes:

    NONE

$flow->allowed_desks();
    Returns a list of allowed desks.

    Throws:

    NONE

    Side Effects:

    NONE

    Notes:

    NONE

$bool = $flow->desk_in_allowed($desk_obj);
    Returns true if desk is in the list of allowed desks.

    Throws:

    NONE

    Side Effects:

    NONE

    Notes:

    NONE

@desks = $flow->required_desks();
    Lists the required desks

    Throws:

    NONE

    Side Effects:

    NONE

    Notes:

    NONE

$bool = $flow->desk_in_required($desk_obj);
    Returns true if the deskref given is in the required list

    Throws:

    NONE

    Side Effects:

    NONE

    Notes:

    NONE

$desk = $flow->get_start_desk();
($flow || undef) = $flow->set_start_desk($desk_id);
$self = $flow->is_start_desk();
    Get/Set the start desk.

    Throws:

    NONE

    Side Effects:

    NONE

    Notes:

$desk || undef = $desk->is_active;
$desk = $desk->activate;
$desk = $desk->deactivate;
    Get/Set the active flag.

    Throws:

    NONE

    Side Effects:

    NONE

    Notes:

    NONE

$desk->remove;
    Get/Set the active flag.

    Throws:

    NONE

    Side Effects:

    NONE

    Notes:

    This method is deprecated.

$save = $workflow->save;
    Save this workflow

    Throws:

    NONE

    Side Effects:

    NONE

    Notes:

    NONE

Private Methods
NONE.

  Private Class Methods
NONE.

  Private Instance Methods

$desk = $desk->_remove_workflow
    Remove this workflow

    Throws:

    NONE

    Side Effects:

    NONE

    Notes:

    NONE

  Private Functions

my $wf_aref = &$get_em( $pkg, $search_href )
my $wf_ids_aref = &$get_em( $pkg, $search_href, 1 )
    Function used by "lookup()" and "list()" to return a list of Bric::Biz::Workflow objects or, if called with an optional third argument, returns a list of Bric::Biz::Workflow object IDs (used by "list_ids()").

    Throws:

    *   Unable to prepare SQL statement.

    *   Unable to connect to database.

    *   Unable to select column into arrayref.

    *   Unable to execute SQL statement.

    *   Unable to bind to columns to statement handle.

    *   Unable to fetch row from statement handle.

    Side Effects: NONE.

    Notes: NONE.

NOTES
NONE

AUTHOR
Garth Webb <garth@perijove.com>

SEE ALSO
Bric, Bric::Biz::Workflow::Parts::Desk, perl