Workflow/Persister/DBI.pm

filter: Statementstmt 78.3% 206 / 263 Branchbran 57.1% 32 / 56 Conditioncond 35.2% 6 / 17 MC/DCmcdc 0.0% 0 / 9 Subroutinesub 87.5% 28 / 32 Podpod 100% 17 / 17 totaltotal 73.3% 289 / 394 CC 40 SCAR 15.7
CC
40
Cov
73%
init_oracle_generators
12.0
assign_generators
10.1
create_history
8.1
CRAP 4.8
« Workflow/Persister/DBI/AutoGeneratedId.pm ↑ Summary Workflow/Config/YAML.pm »
1 package Workflow::Persister::DBI;
2  
3 18 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 18 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 18 ▶use v5.14.0;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 18 ▶use parent qw( Workflow::Persister );
Subroutine BEGIN: called CC=1 SCAR=0.0
7 18 ▶use DateTime;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 18 ▶use DateTime::Format::Strptime;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 18 ▶use DBI;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 18 ▶use Workflow::Exception qw( configuration_error persist_error );
Subroutine BEGIN: called CC=1 SCAR=0.0
11 18 ▶use Workflow::Persister::RandomId;
Subroutine BEGIN: called CC=1 SCAR=0.0
12 18 ▶use Workflow::Persister::DBI::AutoGeneratedId;
Subroutine BEGIN: called CC=1 SCAR=0.0
13 18 ▶use Workflow::Persister::DBI::SequenceId;
Subroutine BEGIN: called CC=1 SCAR=0.0
14 18 ▶use Carp qw(croak);
Subroutine BEGIN: called CC=1 SCAR=0.0
15 18 ▶use Syntax::Keyword::Try;
Subroutine BEGIN: called CC=1 SCAR=0.0
16 18 ▶use Readonly;
Subroutine BEGIN: called CC=1 SCAR=0.0
17  
18 18 Readonly::Scalar my $TRUE => 1;
19 18 Readonly::Scalar my $FALSE => 0;
20  
21 18 $Workflow::Persister::DBI::VERSION = '2.12';
22  
23 18 my @FIELDS = qw( _wf_fields _hist_fields handle dsn user password driver
24 workflow_table history_table date_format parser autocommit options);
25 18 __PACKAGE__->mk_accessors(@FIELDS);
26  
27  
28 17 ▶sub init {
Subroutine init: called CC=7 SCAR=19.8
Pod documented
29 17 my ( $self, $params ) = @_;
30 17 $self->SUPER::init($params);
31  
32 # Default to old date format if not provided so we don't break old configurations.
33 17 $self->date_format('%Y-%m-%d %H:%M');
34  
35 # Default to autocommit on for backward compatibility.
36 17 $self->autocommit($TRUE);
37  
38 # Load user-provided values from config.
39 17 for (qw( dsn user password date_format autocommit )) {
40 85 ▶ $self->$_( $params->{$_} ) if ( defined $params->{$_} );
Branch: 1 branch
BranchTrueFalseTotal
if defined $params->{$_} 41 44 85
41 }
42 17 my %options = ();
43 17 ▶ if ( defined $params->{options} ) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $params->{"options"}) 0 17 17
44 0 for my $option ( @{ $params->{options} } ) {
45 0 $options{$option->{name}} = $option->{value};
46 }
47 }
48 17 $self->options( \%options );
49 17 $self->handle($self->create_handle);
50 my $driver
51 17 ▶ = $self->handle ? $self->handle->{Driver}->{Name} : ($params->{driver} || '');
Branch: 1 branch
BranchTrueFalseTotal
$self->handle ? : 16 1 17
Condition50%1/2
$params->{"driver"} or ""
l!l
10
MC/DC0%0/1
$params->{"driver"} or ""
$params->{"driver"}
Truth table50%1/2
A
A= $params->{"driver"}
Aresult
11
00
52 17 $self->log->debug( "Pulled driver '$driver' from DBI DSN" );
53 17 $self->driver($driver);
54 17 $self->assign_generators( $params, $driver );
55 17 $self->log->info(
56 "Assigned workflow generator '",
57 ref( $self->workflow_id_generator ),
58 "'; ",
59 "history generator '",
60 ref( $self->history_id_generator ),
61 "'"
62 );
63 17 $self->assign_tables($params);
64 17 $self->log->info(
65 "Assigned workflow table '",
66 $self->workflow_table, "'; ", "history table '",
67 $self->history_table, "'"
68 );
69  
70 17 my $parser
71 = DateTime::Format::Strptime->new( pattern => $self->date_format );
72 17 $self->parser($parser);
73 }
74  
75 16 ▶sub create_handle {
Subroutine create_handle: called CC=3 SCAR=11.4
Pod documented
76 16 my ($self, $params) = @_;
77 16 ▶ unless ( $self->dsn ) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($self->dsn) 0 16 16
78 0 configuration_error "DBI persister configuration must include ",
79 "key 'dsn' which maps to the first paramter ",
80 "in the DBI 'connect()' call.";
81 }
82 16 my $dbh;
83 try {
84 16 ▶ $dbh = DBI->connect(
Branch: 1 branch
BranchTrueFalseTotal
$dbh = "DBI"->connect($self->dsn, $self->user, $self->password, $self->options) or croak("Cannot connect to database: $DBI::errstr") 16 0 16
85 $self->dsn,
86 $self->user,
87 $self->password,
88 $self->options
89 )
90 or croak "Cannot connect to database: $DBI::errstr";
91 }
92 16 catch ($error) {
93 0 persist_error $error;
94 }
95 16 $dbh->{RaiseError} = $TRUE;
96 16 $dbh->{PrintError} = $FALSE;
97 16 $dbh->{ChopBlanks} = $TRUE;
98 16 $dbh->{AutoCommit} = $self->autocommit();
99 16 $self->log->debug( "Connected to database '",
100 $self->dsn, "' and ", "assigned to persister ok" );
101  
102 16 return $dbh;
103 }
104  
105 17 ▶sub assign_generators {
Subroutine assign_generators: called CC=7 SCAR=23.2
Pod documented
106 17 my ( $self, $params, $driver ) = @_;
107 17 $self->SUPER::assign_generators($params);
108 return
109 17 ▶ if ($self->workflow_id_generator
Branch: 1 branch
BranchTrueFalseTotal
if $self->workflow_id_generator and $self->history_id_generator 0 17 17
Condition33%1/3
$self->workflow_id_generator and $self->history_id_generator
!ll&&!rl&&r
1700
MC/DC0%0/2
$self->workflow_id_generator and $self->history_id_generator
$self->workflow_id_generator $self->history_id_generator
Truth table33%1/3
A and B
A= $self->workflow_id_generatorB= $self->history_id_generator
ABresult
0X0
100
111
110 and $self->history_id_generator );
111  
112 17 my ( $wf_gen, $history_gen );
113 17 ▶ if ( $driver eq 'Pg' ) {
Branch: 4 branches
BranchTrueFalseTotal
if ($driver eq 'Pg') { } 1 16 17
elsif ($driver eq 'Oracle') { } 0 16 16
elsif ($driver eq 'mysql') { } 0 16 16
elsif ($driver eq 'SQLite') { } 0 16 16
114 1 $self->log->debug("Assigning ID generators for PostgreSQL");
115 1 ( $wf_gen, $history_gen ) = $self->init_postgres_generators($params);
116 } elsif ( $driver eq 'Oracle' ) {
117 0 $self->log->debug("Assigning ID generators for Oracle");
118 0 ( $wf_gen, $history_gen ) = $self->init_oracle_generators($params);
119 } elsif ( $driver eq 'mysql' ) {
120 0 $self->log->debug("Assigning ID generators for MySQL");
121 0 ( $wf_gen, $history_gen ) = $self->init_mysql_generators($params);
122 } elsif ( $driver eq 'SQLite' ) {
123 0 $self->log->debug("Assigning ID generators for SQLite");
124 0 ( $wf_gen, $history_gen ) = $self->init_sqlite_generators($params);
125 } else {
126 16 $self->log->debug("Assigning random ID generators");
127 16 ( $wf_gen, $history_gen ) = $self->init_random_generators($params);
128 }
129 17 $self->workflow_id_generator($wf_gen);
130 17 $self->history_id_generator($history_gen);
131 }
132  
133 1 ▶sub init_postgres_generators {
Subroutine init_postgres_generators: called CC=3 SCAR=11.3
Pod documented
134 1 my ( $self, $params ) = @_;
135 1 my $sequence_select = q{SELECT NEXTVAL( '%s' )};
136 1 ▶ $params->{workflow_sequence} ||= 'workflow_seq';
Condition50%1/2
$params->{"workflow_sequence"} ||= "workflow_seq"
l!l
01
MC/DC0%0/1
$params->{"workflow_sequence"} ||= "workflow_seq"
$params->{"workflow_sequence"}
Truth table50%1/2
A
A= $params->{"workflow_sequence"}
Aresult
11
00
137 1 ▶ $params->{history_sequence} ||= 'workflow_history_seq';
Condition50%1/2
$params->{"history_sequence"} ||= "workflow_history_seq"
l!l
01
MC/DC0%0/1
$params->{"history_sequence"} ||= "workflow_history_seq"
$params->{"history_sequence"}
Truth table50%1/2
A
A= $params->{"history_sequence"}
Aresult
11
00
138 return (
139 Workflow::Persister::DBI::SequenceId->new(
140 { sequence_name => $params->{workflow_sequence},
141 sequence_select => $sequence_select
142 }
143 ),
144 Workflow::Persister::DBI::SequenceId->new(
145 { sequence_name => $params->{history_sequence},
146 1 sequence_select => $sequence_select
147 }
148 )
149 );
150 }
151  
152 0 ▶sub init_oracle_generators {
Subroutine init_oracle_generators: not called CC=3 SCAR=24.8
Pod documented
153 0 my ( $self, $params ) = @_;
154 0 my $sequence_select = q{SELECT %s.NEXTVAL from dual};
155 0 ▶ $params->{workflow_sequence} ||= 'workflow_seq';
Condition0%0/2
$params->{"workflow_sequence"} ||= "workflow_seq"
l!l
00
MC/DC0%0/1
$params->{"workflow_sequence"} ||= "workflow_seq"
$params->{"workflow_sequence"}
Truth table0%0/2
A
A= $params->{"workflow_sequence"}
Aresult
11
00
156 0 ▶ $params->{history_sequence} ||= 'workflow_history_seq';
Condition0%0/2
$params->{"history_sequence"} ||= "workflow_history_seq"
l!l
00
MC/DC0%0/1
$params->{"history_sequence"} ||= "workflow_history_seq"
$params->{"history_sequence"}
Truth table0%0/2
A
A= $params->{"history_sequence"}
Aresult
11
00
157 return (
158 Workflow::Persister::DBI::SequenceId->new(
159 { sequence_name => $params->{workflow_sequence},
160 sequence_select => $sequence_select
161 }
162 ),
163 Workflow::Persister::DBI::SequenceId->new(
164 { sequence_name => $params->{history_sequence},
165 0 sequence_select => $sequence_select
166 }
167 )
168 );
169 }
170  
171 0 ▶sub init_mysql_generators {
Subroutine init_mysql_generators: not called CC=1 SCAR=6.9
Pod documented
172 0 my ( $self, $params ) = @_;
173 0 my $generator = Workflow::Persister::DBI::AutoGeneratedId->new(
174 { from_handle => 'database',
175 handle_property => 'mysql_insertid',
176 }
177 );
178 0 return ( $generator, $generator );
179 }
180  
181 0 ▶sub init_sqlite_generators {
Subroutine init_sqlite_generators: not called CC=1 SCAR=6.9
Pod documented
182 0 my ( $self, $params ) = @_;
183 0 my $generator = Workflow::Persister::DBI::AutoGeneratedId->new(
184 { func_property => 'last_insert_rowid' } );
185 0 return ( $generator, $generator );
186 }
187  
188 17 ▶sub assign_tables {
Subroutine assign_tables: called CC=3 SCAR=11.3
Pod documented
189 17 my ( $self, $params ) = @_;
190 17 ▶ my $wf_table = $params->{workflow_table} || 'workflow';
Condition50%1/2
$params->{'workflow_table'} || 'workflow'
l!l
017
MC/DC0%0/1
$params->{'workflow_table'} || 'workflow'
$params->{'workflow_table'}
Truth table50%1/2
A
A= $params->{'workflow_table'}
Aresult
11
00
191 17 ▶ my $hist_table = $params->{history_table} || 'workflow_history';
Condition50%1/2
$params->{'history_table'} || 'workflow_history'
l!l
017
MC/DC0%0/1
$params->{'history_table'} || 'workflow_history'
$params->{'history_table'}
Truth table50%1/2
A
A= $params->{'history_table'}
Aresult
11
00
192 17 $self->workflow_table($wf_table);
193 17 $self->history_table($hist_table);
194 }
195  
196 ########################################
197 # PERSISTENCE IMPLEMENTATION
198  
199 22 ▶sub create_workflow {
Subroutine create_workflow: called CC=5 SCAR=17.2
Pod documented
200 22 my ( $self, $wf ) = @_;
201  
202 22 $self->_init_fields();
203 22 my @wf_fields = @{ $self->_wf_fields };
204 22 my @fields = @wf_fields[ 1, 2, 3 ];
205 22 my @values = (
206 $wf->type,
207 $wf->state,
208 DateTime->now( time_zone => $wf->time_zone() )
209 ->strftime( $self->date_format() ),
210 );
211 22 my $dbh = $self->handle;
212  
213 22 my $id = $self->workflow_id_generator->pre_fetch_id($dbh);
214 22 ▶ if ($id) {
Branch: 1 branch
BranchTrueFalseTotal
if ($id) 22 0 22
215 22 push @fields, $wf_fields[0];
216 22 push @values, $id;
217 22 $self->log->debug("Got ID from pre_fetch_id: $id");
218 }
219 22 my $sql = 'INSERT INTO %s ( %s ) VALUES ( %s )';
220  
221 $sql = sprintf $sql,
222 $self->handle->quote_identifier( $self->workflow_table ),
223 join( ', ', @fields ),
224 22 join( ', ', map {'?'} @values );
225  
226 22 ▶ if ( $self->log->is_debug ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->log->is_debug) 0 22 22
227 0 $self->log->debug("Will use SQL: $sql");
228 0 $self->log->debug( "Will use parameters: ", join ', ', @values );
229 }
230  
231 22 my ($sth);
232 try {
233 22 $sth = $dbh->prepare($sql);
234 22 $sth->execute(@values);
235 }
236 22 catch ($error) {
237 0 persist_error "Failed to create workflow: $error";
238 }
239 22 ▶ unless ($id) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($id) 0 22 22
240 0 $id = $self->workflow_id_generator->post_fetch_id( $dbh, $sth );
241 0 ▶ unless ($id) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($id) 0 0 0
242 0 persist_error "No ID found using generator '",
243 ref( $self->workflow_id_generator ), "'";
244 }
245 }
246 22 $sth->finish;
247  
248 22 $wf->id($id);
249 22 return $id;
250 }
251  
252 7 ▶sub fetch_workflow {
Subroutine fetch_workflow: called CC=3 SCAR=11.2
Pod documented
253 7 my ( $self, $wf_id ) = @_;
254 7 $self->_init_fields();
255 7 my $sql = q{SELECT %s, %s FROM %s WHERE %s = ?};
256 7 my @wf_fields = @{ $self->_wf_fields };
257 7 $sql = sprintf $sql,
258 $wf_fields[2], $wf_fields[3],
259 $self->handle->quote_identifier( $self->workflow_table ),
260 $wf_fields[0];
261  
262 7 ▶ if ( $self->log->is_debug ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->log->is_debug) 0 7 7
263 0 $self->log->debug("Will use SQL: $sql");
264 0 $self->log->debug("Will use parameters: $wf_id");
265 }
266  
267 7 my ($sth);
268 try {
269 7 $sth = $self->handle->prepare($sql);
270 7 $sth->execute($wf_id);
271 }
272 7 catch ($error) {
273 0 persist_error "Cannot fetch workflow: $error";
274 }
275 7 my $row = $sth->fetchrow_arrayref;
276 7 ▶ return unless ($row);
Branch: 1 branch
BranchTrueFalseTotal
unless $row 1 6 7
277  
278 return {
279 6 state => $row->[0],
280 last_update => $self->parser->parse_datetime( $row->[1] ),
281 };
282 }
283  
284 34 ▶sub update_workflow {
Subroutine update_workflow: called CC=2 SCAR=7.1
Pod documented
285 34 my ( $self, $wf ) = @_;
286 34 $self->_init_fields();
287 34 my $sql = q{UPDATE %s SET %s = ?, %s = ? WHERE %s = ?};
288 34 my @wf_fields = @{ $self->_wf_fields };
289 34 $sql = sprintf $sql,
290 $self->handle->quote_identifier( $self->workflow_table ),
291 $wf_fields[2], $wf_fields[3], $wf_fields[0];
292 34 my $update_date = DateTime->now( time_zone => $wf->time_zone() )
293 ->strftime( $self->date_format() );
294  
295 34 ▶ if ( $self->log->is_debug ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->log->is_debug) 0 34 34
296 0 $self->log->debug("Will use SQL: $sql");
297 0 $self->log->debug( "Will use parameters: ",
298 join ', ', $wf->state, $update_date, $wf->id );
299 }
300  
301 34 my ($sth);
302 try {
303 34 $sth = $self->handle->prepare($sql);
304 34 $sth->execute( $wf->state, $update_date, $wf->id );
305 }
306 34 catch ($error) {
307 0 persist_error $error;
308 }
309 34 $self->log->info( "Workflow ", $wf->id, " updated ok" );
310 }
311  
312 56 ▶sub create_history {
Subroutine create_history: called CC=7 SCAR=20.9
Pod documented
313 56 my ( $self, $wf, @history ) = @_;
314 56 $self->_init_fields();
315  
316 56 my $dbh = $self->handle;
317 56 my $generator = $self->history_id_generator;
318 56 foreach my $h (@history) {
319 30 ▶ next if ( $h->is_saved );
Branch: 1 branch
BranchTrueFalseTotal
if $h->is_saved 0 30 30
320 30 my $id = $generator->pre_fetch_id($dbh);
321 30 my @hist_fields = @{ $self->_hist_fields };
322 30 my @fields = @hist_fields[ 1 .. 6 ];
323 30 my @values = (
324 $wf->id, $h->action, $h->description, $h->state, $h->user,
325 $h->date->strftime( $self->date_format() ),
326 );
327 30 ▶ if ($id) {
Branch: 1 branch
BranchTrueFalseTotal
if ($id) 30 0 30
328 30 push @fields, $hist_fields[0];
329 30 push @values, $id;
330 }
331 30 my $sql = 'INSERT INTO %s ( %s ) VALUES ( %s )';
332  
333 $sql = sprintf $sql, $dbh->quote_identifier( $self->history_table ),
334 30 join( ', ', @fields ), join( ', ', map {'?'} @values );
335 30 ▶ if ( $self->log->is_debug ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->log->is_debug) 0 30 30
336 0 $self->log->debug("Will use SQL: $sql");
337 0 $self->log->debug( "Will use parameters: ", join ', ', @values );
338 }
339  
340 30 my ($sth);
341 try {
342 30 $sth = $dbh->prepare($sql);
343 30 $sth->execute(@values);
344 }
345 30 catch ($error) {
346 0 persist_error $error;
347 }
348 30 ▶ unless ($id) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($id) 0 30 30
349 0 $id = $self->history_id_generator->post_fetch_id( $dbh, $sth );
350 0 ▶ unless ($id) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($id) 0 0 0
351 0 persist_error "No ID found using generator '",
352 ref( $self->history_id_generator ), "'";
353 }
354 }
355 30 $h->id($id);
356 30 $h->set_saved();
357 30 $self->log->info( "Workflow history entry ", $id, " created ok" );
358 }
359 56 return @history;
360 }
361  
362 4 ▶sub fetch_history {
Subroutine fetch_history: called CC=3 SCAR=11.2
Pod documented
363 4 my ( $self, $wf ) = @_;
364 4 $self->_init_fields();
365  
366 4 my $sql = qq{SELECT %s FROM %s WHERE %s = ? ORDER BY %s DESC};
367 4 my @hist_fields = @{ $self->_hist_fields };
368 4 my $history_fields = join ', ', @hist_fields;
369 4 $sql = sprintf $sql, $history_fields,
370 $self->handle->quote_identifier($self->history_table),
371 $hist_fields[1], $hist_fields[6];
372  
373 4 ▶ if ( $self->log->is_debug ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->log->is_debug) 0 4 4
374 0 $self->log->debug("Will use SQL: $sql");
375 0 $self->log->debug( "Will use parameters: ", $wf->id );
376 }
377  
378 4 my ($sth);
379 try {
380 4 $sth = $self->handle->prepare($sql);
381 4 $sth->execute( $wf->id );
382 }
383 4 catch ($error) {
384 0 $self->log->error("Caught error fetching workflow history: $error");
385 0 persist_error $error;
386 }
387 4 $self->log->debug("Prepared and executed ok");
388  
389 4 my @history = ();
390 4 ▶ while ( my $row = $sth->fetchrow_arrayref ) {
Branch: 1 branch
BranchTrueFalseTotal
if (my $row = $sth->fetchrow_arrayref) 2 4 6
391 2 $self->log->debug("Fetched history object '$row->[0]'");
392 2 push @history, {
393 id => $row->[0],
394 workflow_id => $row->[1],
395 action => $row->[2],
396 description => $row->[3],
397 state => $row->[4],
398 user => $row->[5],
399 date => $self->parser->parse_datetime( $row->[6] ),
400 };
401 }
402 4 $sth->finish;
403 4 return @history;
404 }
405  
406 56 ▶sub commit_transaction {
Subroutine commit_transaction: called CC=2 SCAR=11.6
Pod documented
407 56 my ( $self, $wf ) = @_;
408 56 ▶ if ( not $self->autocommit() ) {
Branch: 1 branch
BranchTrueFalseTotal
if (not $self->autocommit) 0 56 56
409 try {
410 0 $self->handle->commit();
411 }
412 0 catch ($error) {
413 0 $self->log->error("Caught error committing transaction: $error");
414 0 persist_error $error;
415 }
416 0 $self->log->debug('Committed transaction.');
417 }
418 }
419  
420 0 ▶sub rollback_transaction {
Subroutine rollback_transaction: not called CC=2 SCAR=17.9
Pod documented
421 0 my ( $self, $wf ) = @_;
422 0 ▶ if ( not $self->autocommit() ) {
Branch: 1 branch
BranchTrueFalseTotal
if (not $self->autocommit) { } 0 0 0
423 try {
424 0 $self->handle->rollback();
425 }
426 0 catch ($error) {
427 0 $self->log->error("Caught error rolling back transaction: $error");
428 0 persist_error $error;
429 }
430 0 $self->log->debug('Rolled back transaction.');
431 }
432 else {
433 0 $self->log->warn(
434 'Transaction NOT rolled back due to "autocommit" being enabled.'
435 );
436 }
437 }
438  
439 ##########
440 # FIELDS
441  
442 # Allow subclasses to override the fieldnames
443  
444 123 ▶sub _init_fields {
Subroutine _init_fields: called CC=3 SCAR=11.0
445 123 my ($self) = @_;
446 123 ▶ unless ( $self->_wf_fields ) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($self->_wf_fields) 14 109 123
447 $self->_wf_fields(
448 [
449 map {
450 14 $self->handle->quote_identifier($_)
451 } $self->get_workflow_fields()
452 ]);
453 }
454 123 ▶ unless ( $self->_hist_fields ) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($self->_hist_fields) 14 109 123
455 $self->_hist_fields(
456 [
457 map {
458 14 $self->handle->quote_identifier($_)
459 } $self->get_history_fields()
460 ]);
461 }
462 }
463  
464 13 ▶sub get_workflow_fields {
Subroutine get_workflow_fields: called CC=1 SCAR=0.0
Pod documented
465 13 return qw( workflow_id type state last_update );
466 }
467  
468 13 ▶sub get_history_fields {
Subroutine get_history_fields: called CC=1 SCAR=0.0
Pod documented
469 13 return qw( workflow_hist_id workflow_id
470 action description state
471 workflow_user history_date );
472 }
473  
474 18 1;
475  
476 __END__
« Workflow/Persister/DBI/AutoGeneratedId.pm ↑ Summary Workflow/Config/YAML.pm »