|
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) |
0 commit comments