Workflo...er::File(3)

πŸ“¦
version 2.09 Β· 2 versions
, in fedora 44

πŸ’– Workflow::Persister::File πŸ’–

okay bestie, buckle up β€” this is the User Contributed Perl Documentation page for Workflow::Persister::File, and it's genuinely one of the cutest little persister modules out there. she's a Perl thing. she saves stuff. let's get into it 🫢


✨ NAME ✨

Workflow::Persister::File β€” persist workflow and history to the filesystem πŸ’ΎπŸŒΈ


🌈 VERSION 🌈

This documentation describes version 2.09 of this package. yes, she's been around, she's got lore, she's iconic.


πŸŽ€ SYNOPSIS πŸŽ€

here's the whole vibe, literally just drop this into your config:

 persister:
 - name: MainPersister
   class: Workflow::Persister::File
   path: /home/workflow/storage

and that's it. that's the whole thing. she's low maintenance fr fr πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

so this is the main persistence class for storing the workflow and workflow history records to a filesystem, so you can come back and retrieve them later like the little archives they are. πŸ“‚βœ¨

the data gets stored in serialized Perl data structure files. no cap. that's the whole storage strategy and honestly? it ate.


πŸ’œ METHODS πŸ’œ

constitute_object

this method deserializes an object. she's bringing it back to life, resurrection era 🧚

  • takes a single parameter of an filesystem path pointing to an object
  • returns the re-instantiated object or dies πŸ’€
bestie. it literally dies. no soft failure, no vibes-based recovery. just death.

create_history

serializes history records associated with a workflow object πŸ“œπŸ’–

  • takes two parameters: a workflow object and an array of workflow history objects
  • returns: the provided array of workflow history objects upon success

create_workflow

serializes a workflow into the persistance entity configured by our workflow.

  • takes a single parameter: a workflow object
  • returns a single value, a id for unique identification of out serialized workflow for possible deserialization.

that id is your little name tag so you can find her again later 🏷️

fetch_history

deserializes history records associated with a workflow object πŸ”

  • takes a single parameter: a workflow object
  • returns an array of workflow history objects upon success

fetch_workflow

deserializes a workflow from the persistance entity configured by our workflow.

  • takes a single parameter: the unique id assigned to our workflow upon serialization (see "create_workflow")

returns a hashref consisting of two keys:

  • state, the workflows current state
  • last_update, date indicating last update

two keys, two besties, both essential 🌸

init ( \%params )

method to initialize the persister object. sets up the configured generators πŸ› οΈβœ¨

throws a Workflow::Exception if a valid filesystem path is not provided with the parameters.

so like… give her a path. she needs a path. no path = exception, and not the fun kind 😭

serialize_object

method that writes a given object to a given path. ✍️

  • takes two parameters: path (a filesystem path) and an object
  • throws Workflow::Exception if unable to serialize the given object to the given path
  • returns: Nothing

she returns nothing and she's not sorry about it. main character energy πŸ‘‘

update_workflow

updates a serialized workflow in the persistance entity configured by our workflow. πŸ”„

  • takes a single parameter: a workflow object
  • returns: Nothing

πŸ“ TODO πŸ“

  • refactor "constitute_object", no checks are made on filesystem prior to deserialization attempt.
okay so this is the known little flaw. she just goes for it. no pre-flight check, no vibe check on the filesystem, straight to deserialization. noted. πŸ™ˆ

πŸ’€ SEE ALSO πŸ’€

  • Workflow::Persister

go read that one too, she's the parent energy 🫢


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


πŸ‘‘ AUTHORS πŸ‘‘

Please see Workflow


and that's the page bestie!! ✨ this was perl v5.42.0, dated 2026-01-17, brought to you by the Workflo...er::File(3) girlies. slay, stay serialized, mwah πŸ’–πŸ’…πŸŒˆ

πŸ“¦ where this page comes from