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
Workflow::Persister(3) User Contributed Perl Documentation Workflow::Persister(3)

Workflow::Persister - Base class for workflow persistence

This documentation describes version 1.60 of this package

 # Associate a workflow with a persister
 <workflow type="Ticket"
           persister="MainDatabase">
 ...

 # Declare a persister
 <persister name="MainDatabase"
            class="Workflow::Persister::DBI"
            driver="MySQL"
            dsn="DBI:mysql:database=workflows"
            user="wf"
            password="mypass"/>

 # Declare a separate persister
 <persister name="FileSystem"
            class="Workflow::Persister::File"
            path="/path/to/my/workflow"/>

This is the base class for persisting workflows. It does not implement anything itself but actual implementations should subclass it to ensure they fulfill the contract.

The job of a persister is to create, update and fetch the workflow object plus any data associated with the workflow. It also creates and fetches workflow history records.

create_workflow( $workflow )

Stub that warns that the method should be overwritten in the derived Persister. Since this is a SUPER class.

Generate an ID for the workflow, serialize the workflow data (ID and state) and set the ID in the workflow.

Returns the ID for the workflow.

update_workflow( $workflow )

Stub that warns that the method should be overwritten in the derived Persister. Since this is a SUPER class.

Update the workflow state.

Returns nothing.

fetch_workflow( $workflow_id )

Stub that warns that the method should be overwritten in the derived Persister. Since this is a SUPER class.

Retrieve the workflow data corresponding to $workflow_id. It not found return undef, if found return a hashref with at least the keys "state" and "last_update" (a DateTime instance).

create_history( $workflow, @history )

Stub that warns that the method should be overwritten in the derived Persister. Since this is a SUPER class.

Serialize all objects in @history for later retrieval.

Returns @history, the list of history objects, with the history "id" and "saved" values set according to the saved results.

fetch_history( $workflow )

Stub that warns that the method should be overwritten in the derived Persister. Since this is a SUPER class.

The derived class method should return a list of Workflow::History objects.

get_create_user( $workflow )

When creating an initial Workflow::History record to insert into the database, the return value of this method is used for the value of the "user" field.

Override this method to change the value from the default, "n/a".

get_create_description( $workflow )

When creating an initial Workflow::History record to insert into the database, the return value of this method is used for the value of the "description" field.

Override this method to change the value from the default, "Create new workflow".

get_create_action( $workflow )

When creating an initial Workflow::History record to insert into the database, the return value of this method is used for the value of the "action" field.

Override this method to change the value from the default, "Create workflow".

assign_generators( \%params )

Assigns proper generators based on intialization, see "init"

fetch_extra_workflow_data ( $workflow )

A stub that warns that the method should be overwritten in the derived Persister. Since this is a SUPER class.

commit_transaction

Commit the current transaction if the persister supports transactions. This stub does not have to be overridden. It is not executed if autocommit is on.

rollback_transaction

Roll back the current transaction if the persister supports transactions. This stub does not have to be overridden. It is not executed if autocommit is on.

init

Method to initialize persister based on configuration.

init_random_generators( \%params )

Initializes random id generators, takes the following named parameters:

length, of random id to be generated

Returns two identical random id generator objects in list context.

init_uuid_generators( \%params )

Initializes UUID generators, takes no parameters

Returns two identical UUID generator objects in list context.

  • refactor init_random_generators, returns two similar objects?
  • refactor init_uuid_generators, returns two similar objects?
  • refactor init_uuid_generators, takes no parameters, even though we shift parameters in?

  • Workflow::Factory
  • Workflow::History

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

Please see the LICENSE

Please see Workflow
2022-03-02 perl v5.32.1

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

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