Skip to content

Commit ef0f7b7

Browse files
authored
Factor out of jonasbn/perl-workflow (#2)
* Initial commit - factoring SPOPS support into a separate repository Factored out of https://github.com/jonasbn/perl-workflow, this repository contains SPOPS support for the Perl Workflow library. * README.md generated from main module
1 parent a3641df commit ef0f7b7

File tree

7 files changed

+831
-1
lines changed

7 files changed

+831
-1
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,5 @@ inc/
3333
/MANIFEST.bak
3434
/pm_to_blib
3535
/*.zip
36+
37+
t/workflow_tests.log

README.md

+111-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,111 @@
1-
# perl-workflow-persister-spops
1+
# NAME
2+
3+
Workflow::Persister::SPOPS - Persist workflows using SPOPS
4+
5+
# VERSION
6+
7+
This documentation describes version 1.53 of this package
8+
9+
# SYNOPSIS
10+
11+
<persister name="SPOPSPersister"
12+
class="Workflow::Persister::SPOPS"
13+
workflow_class="My::Persist::Workflow"
14+
history_class="My::Persist::History"/>
15+
16+
# DESCRIPTION
17+
18+
## Overview
19+
20+
Use a SPOPS classes to persist your workflow and workflow history
21+
information. Configuration is simple: just specify the class names and
22+
everything else is done.
23+
24+
We do not perform any class initialization, so somewhere in your
25+
server/process startup code you should have something like:
26+
27+
my $config = get_workflow_and_history_config();
28+
SPOPS::Initialize->process({ config => $config });
29+
30+
This will generate the classes named in the persister configuration.
31+
32+
## SPOPS Configuration
33+
34+
**NOTE**: The configuration for your workflow history object **must**
35+
use the [SPOPS::Tool::DateConvert](https://metacpan.org/pod/SPOPS%3A%3ATool%3A%3ADateConvert) to translate the 'history\_date'
36+
field into a [DateTime](https://metacpan.org/pod/DateTime) object. We assume when we fetch the history
37+
object that this has already been done.
38+
39+
## METHODS
40+
41+
### init ( \\%params)
42+
43+
This method initializes the SPOPS persistance entity.
44+
45+
It requires that a workflow\_class and a history\_class are specified. If not the
46+
case [Workflow::Exception](https://metacpan.org/pod/Workflow%3A%3AException)s are thrown.
47+
48+
### create\_workflow
49+
50+
Serializes a workflow into the persistance entity configured by our workflow.
51+
52+
Takes a single parameter: a workflow object
53+
54+
Returns a single value, a id for unique identification of out serialized
55+
workflow for possible deserialization.
56+
57+
### fetch\_workflow
58+
59+
Deserializes a workflow from the persistance entity configured by our workflow.
60+
61+
Takes a single parameter: the unique id assigned to our workflow upon
62+
serialization (see ["create\_workflow"](#create_workflow)).
63+
64+
Returns a hashref consisting of two keys:
65+
66+
- state, the workflows current state
67+
- last\_update, date indicating last update
68+
69+
### update\_workflow
70+
71+
Updates a serialized workflow in the persistance entity configured by our
72+
workflow.
73+
74+
Takes a single parameter: a workflow object
75+
76+
Returns: Nothing
77+
78+
### create\_history
79+
80+
Serializes history records associated with a workflow object
81+
82+
Takes two parameters: a workflow object and an array of workflow history objects
83+
84+
Returns: provided array of workflow history objects upon success
85+
86+
### fetch\_history
87+
88+
Deserializes history records associated with a workflow object
89+
90+
Takes a single parameter: a workflow object
91+
92+
Returns an array of workflow history objects upon success
93+
94+
# SEE ALSO
95+
96+
- [Workflow::Persister](https://metacpan.org/pod/Workflow%3A%3APersister)
97+
- [SPOPS](https://metacpan.org/pod/SPOPS)
98+
- [SPOPS::Tool::DateConvert](https://metacpan.org/pod/SPOPS%3A%3ATool%3A%3ADateConvert)
99+
100+
# COPYRIGHT
101+
102+
Copyright (c) 2003-2021 Chris Winters. All rights reserved.
103+
104+
This library is free software; you can redistribute it and/or modify
105+
it under the same terms as Perl itself.
106+
107+
Please see the `LICENSE`
108+
109+
# AUTHORS
110+
111+
Please see [Workflow](https://metacpan.org/pod/Workflow)

dist.ini

+90
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
; REF: Dist::Zilla https://metacpan.org/pod/Dist::Zilla
2+
name = Workflow-Persister-SPOPS
3+
author = Chris Winters <[email protected]>
4+
license = Perl_5
5+
copyright_holder = Chris Winters
6+
7+
; REF: https://metacpan.org/pod/Dist::Zilla::PluginBundle::Filter
8+
[@Filter]
9+
-bundle = @Basic
10+
-remove = GatherDir
11+
12+
; REF: https://metacpan.org/pod/Dist::Zilla::Plugin::GatherDir
13+
[GatherDir]
14+
; this plugin needs no config and gathers most of your files
15+
exclude_filename = LICENSE
16+
17+
; REF: Dist::Zilla https://metacpan.org/pod/Dist::Zilla
18+
;[@Basic]
19+
20+
; REF: Dist::Zilla::Plugin::GithubMeta: https://metacpan.org/pod/Dist::Zilla::Plugin::GithubMeta
21+
[GithubMeta]
22+
homepage = https://github.com/jonasbn/perl-workflow-persister-spops
23+
issues = 1 ; enabling issues on github
24+
25+
; REF: Dist::Zilla::Plugin::ReadmeAnyFromPod: https://metacpan.org/pod/Dist::Zilla::Plugin::ReadmeAnyFromPod
26+
; REF: http://blogs.perl.org/users/ovid/2014/03/a-simple-distini-for-distzilla.html
27+
[ ReadmeAnyFromPod / MarkdownInRoot ]
28+
filename = README.md
29+
30+
; REF: Dist::Zilla::Plugin:::VersionFromMainModule https://metacpan.org/pod/Dist::Zilla::Plugin::VersionFromMainModule
31+
[VersionFromMainModule]
32+
33+
; REF: Dist::Zilla::Plugin::ExtraTests https://metacpan.org/pod/Dist::Zilla::Plugin::ExtraTests
34+
[ExtraTests]
35+
36+
; REF: Dist::Zilla::Plugin::Test::Perl::Critic https://metacpan.org/pod/Dist::Zilla::Plugin::Test::Perl::Critic
37+
[Test::Perl::Critic]
38+
critic_config = t/perlcriticrc
39+
40+
; REF: Dist::Zilla::Plugin::PodCoverageTests: https://metacpan.org/pod/Dist::Zilla::Plugin::PodCoverageTests
41+
[PodCoverageTests]
42+
43+
; REF: Dist::Zilla::Plugin::PodSyntaxTests: https://metacpan.org/pod/Dist::Zilla::Plugin::PodSyntaxTests
44+
[PodSyntaxTests]
45+
46+
; REF: Dist::Zilla::Plugin::Test::Kwalitee: https://metacpan.org/pod/Dist::Zilla::Plugin::Test::Kwalitee
47+
[Test::Kwalitee]
48+
49+
; REF: Dist::Zilla::Plugin::Test::Compile: https://metacpan.org/pod/Dist::Zilla::Plugin::Test::Compile
50+
[Test::Compile]
51+
fail_on_warning = none
52+
53+
; REF: Dist::Zilla::Plugin::Test::CPAN::Changes: https://metacpan.org/pod/Dist::Zilla::Plugin::Test::CPAN::Changes
54+
; [Test::CPAN::Changes]
55+
56+
; REF: Dist::Zilla::Plugin::MetaJSON: https://metacpan.org/pod/Dist::Zilla::Plugin::MetaJSON
57+
[MetaJSON]
58+
59+
; REF: Dist::Zilla::Plugin::Test::CPAN::Meta::JSON: https://metacpan.org/pod/Dist::Zilla::Plugin::Test::CPAN::Meta::JSON
60+
[Test::CPAN::Meta::JSON]
61+
62+
; REF: Dist::Zilla::Plugin::MetaProvides::Package : https://metacpan.org/pod/Dist::Zilla::Plugin::MetaProvides::Package
63+
[MetaProvides::Package]
64+
inherit_version = 0 ;optional flag
65+
inherit_missing = 0 ;optional flag
66+
meta_noindex = 1 ;optional flag
67+
68+
; REF: Dist::Zilla https://metacpan.org/pod/Dist::Zilla
69+
[Prereqs]
70+
perl = 5.006
71+
DateTime = 0.15
72+
Log::Log4perl = 0.34
73+
Workflow::Persister = 1.53
74+
Workflow::Exception = 1.53
75+
76+
; REF: Dist::Zilla https://metacpan.org/pod/Dist::Zilla
77+
[Prereqs / Recommends]
78+
SPOPS = 0
79+
80+
; REF: Dist::Zilla https://metacpan.org/pod/Dist::Zilla
81+
[Prereqs / TestRequires]
82+
DBD::Mock = 0.10
83+
List::MoreUtils = 0
84+
SPOPS = 0
85+
Test::Exception = 0
86+
Test::More = 0.88
87+
Test::Kwalitee = 1.21 ; from Dist::Zilla
88+
Pod::Coverage::TrustPod = 0 ; from Dist::Zilla
89+
Test::Pod = 1.41 ; from Dist::Zilla
90+
Test::Pod::Coverage = 1.08 ; from Dist::Zilla

0 commit comments

Comments
 (0)