GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  WORKFLOW::PERSISTER::DBI::EXTRADATA (3)

.ds Aq ’

NAME

Workflow::Persister::DBI::ExtraData - Fetch extra data with each workflow and put it into the context

CONTENTS

VERSION

This documentation describes version 1.05 of this package

SYNOPSIS



 <persister name="MyPersister"
            class="Workflow::Persister::DBI::ExtraData"
            dsn="DBI:mysql:database=workflows"
            user="wf"
            password="mypass"
            extra_table="workflow_ticket"
            extra_data_field="ticket_id"
            extra_context_key="ticket_id"/>



DESCRIPTION

    Overview

Simple subclass of Workflow::Persister::DBI to allow you to declare an extra table and data field(s) from which to fetch data whenever you fetch a workflow. There is a simple restriction: the table must have a field ’workflow_id’ of the same datatype as the ’workflow_id’ field in the ’workflow’ table.

    Examples



 # Specify a single field ticket_id from the table workflow_ticket
 # and store it in the context using the same key:

 <persister
     ...
     extra_table="workflow_ticket"
     extra_data_field="ticket_id"
     ...

 # How you would use this:
 my $wf = FACTORY->fetch_workflow( Ticket, 55 );
 print "Workflow is associated with ticket: ",
       $wf->context->param( ticket_id );

 # Specify a single field ticket_id from the table workflow_ticket
 # and store it in the context using a different key

 <persister
     ...
     extra_table="workflow_ticket"
     extra_data_field="ticket_id"
     extra_context_key="THE_TICKET_ID"
     ...

 # How you would use this:
 my $wf = FACTORY->fetch_workflow( Ticket, 55 );
 print "Workflow is associated with ticket: ",
       $wf->context->param( THE_TICKET_ID );

 # Specify multiple fields (ticket_id, last_viewer,
 # last_view_date) to pull from the workflow_ticket table:

 <persister
     ...
     extra_table="workflow_ticket"
     extra_data_field="ticket_id,last_viewer,last_view_date"
     ...

 # How you would use this:
 my $wf = FACTORY->fetch_workflow( Ticket, 55 );
 print "Workflow is associated with ticket: ",
       $wf->context->param( ticket_id ), " ",
       "which was last viewed by ",
       $wf->context->param( last_viewer ), " on ",
       $wf->context->param( last_view_date );



    Configuration

<B>extra_tableB> (required)

Table where the extra data are kept.

<B>extra_data_fieldB> (required)

Can be a single field or a comma-separated list of fields, all in the same table. If a single field specified you have the option of declaring a different extra_context_key under which the value should be stored in the workflow context. Otherwise the values are stored by the field names in the workflow context.

<B>extra_context_keyB> (optional)

Key under which to save the data from extra_data_field in the workflow context.

Note: this is ignored when you specify multiple fields in extra_data_field; we just use the fieldnames for the context keys in that case. And if you specify a single data field and do not specify a context key we also use the data field name.

    METHODS

init ( \%params )

Initializes persister for extra workflow data.

Throws Workflow::Exception if initialization is not successful.

fetch_extra_workflow_data ( $wf )

Fetches extra data from database and feeds this to context of given workflow.

Takes a single parameter, a workflow object to which extra data are feed if retrieved successfully.

Throws Workflow::Exception if retrieval is not successful.

COPYRIGHT

Copyright (c) 2003-2007 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

Jonas B. Nielsen (jonasbn) <jonasbn@cpan.org> is the current maintainer.

Chris Winters <chris@cwinters.com>, original author.

Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 WORKFLOW::PERSISTER::DBI::EXTRADATA (3) 2016-04-03

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.