1Workflow::Persister(3)User Contributed Perl DocumentationWorkflow::Persister(3)
2
3
4

NAME

6       Workflow::Persister - Base class for workflow persistence
7

VERSION

9       This documentation describes version 1.09 of this package
10

SYNOPSIS

12        # Associate a workflow with a persister
13        <workflow type="Ticket"
14                  persister="MainDatabase">
15        ...
16
17        # Declare a persister
18        <persister name="MainDatabase"
19                   class="Workflow::Persister::DBI"
20                   driver="MySQL"
21                   dsn="DBI:mysql:database=workflows"
22                   user="wf"
23                   password="mypass"/>
24
25        # Declare a separate persister
26        <persister name="FileSystem"
27                   class="Workflow::Persister::File"
28                   path="/path/to/my/workflow"/>
29

DESCRIPTION

31       This is the base class for persisting workflows. It does not implement
32       anything itself but actual implementations should subclass it to ensure
33       they fulfill the contract.
34
35       The job of a persister is to create, update and fetch the workflow
36       object plus any data associated with the workflow. It also creates and
37       fetches workflow history records.
38

SUBCLASSING

40   Methods
41       create_workflow( $workflow )
42
43       Stub that warns that the method should be overwritten in the derived
44       Persister. Since this is a SUPER class.
45
46       Generate an ID for the workflow, serialize the workflow data (ID and
47       state) and set the ID in the workflow.
48
49       update_workflow( $workflow )
50
51       Stub that warns that the method should be overwritten in the derived
52       Persister. Since this is a SUPER class.
53
54       Update the workflow state.
55
56       fetch_workflow( $workflow_id )
57
58       Stub that warns that the method should be overwritten in the derived
59       Persister. Since this is a SUPER class.
60
61       Retrieve the workflow data corresponding to $workflow_id. It not found
62       return undef, if found return a hashref with the data.
63
64       create_history( $workflow, @history )
65
66       Stub that warns that the method should be overwritten in the derived
67       Persister. Since this is a SUPER class.
68
69       Serialize all objects in @history for later retrieval.
70
71       fetch_history( $workflow )
72
73       Stub that warns that the method should be overwritten in the derived
74       Persister. Since this is a SUPER class.
75
76       The derived class method should return a list of Workflow::History
77       objects.
78
79       assign_generators( \%params )
80
81       Assigns proper generators based on intialization, see "init"
82
83       fetch_extra_workflow_data ( $workflow )
84
85       A stub that warns that the method should be overwritten in the derived
86       Persister. Since this is a SUPER class.
87
88       commit_transaction
89
90       Commit the current transaction if the persister supports transactions.
91       This stub does not have to be overridden. It is not executed if
92       autocommit is on.
93
94       rollback_transaction
95
96       Roll back the current transaction if the persister supports
97       transactions.  This stub does not have to be overridden. It is not
98       executed if autocommit is on.
99
100       init
101
102       Method to initialize persister based on configuration.
103
104       init_random_generators( \%params )
105
106       Initializes random id generators, takes the following named parameters:
107
108       ·   length, of random id to be generated
109
110       Returns two identical random id generator objects in list context.
111
112       init_uuid_generators( \%params )
113
114       Initializes UUID generators, takes no parameters
115
116       Returns two identical UUID generator objects in list context.
117

TODO

119       ·   refactor init_random_generators, returns two similar objects?
120
121       ·   refactor init_uuid_generators, returns two similar objects?
122
123       ·   refactor init_uuid_generators, takes no parameters, even though we
124           shift parameters in?
125

SEE ALSO

127       Workflow::Factory
128
129       Workflow::History
130
132       Copyright (c) 2003-2007 Chris Winters. All rights reserved.
133
134       This library is free software; you can redistribute it and/or modify it
135       under the same terms as Perl itself.
136

AUTHORS

138       Jonas B. Nielsen (jonasbn) <jonasbn@cpan.org> is the current
139       maintainer.
140
141       Chris Winters <chris@cwinters.com>, original author.
142
143
144
145perl v5.12.0                      2010-05-07            Workflow::Persister(3)
Impressum