Workflo...xtraData(3)
π Workflo...xtraData(3) π
okay bestie, so this is a page from the User Contributed Perl Documentation for the module Workflow::Persister::DBI::ExtraData. yes the manpage title is literally abbreviated with dots, we don't make the rules, we just slay within them π
β¨ NAME β¨
Workflow::Persister::DBI::ExtraData β grab extra data alongside every workflow and yeet it straight into the context π
πΈ VERSION πΈ
This documentation describes version 2.09 of this package. periodt.
π¦ SYNOPSIS π¦
persister:
- name: MyPersister
class: Workflow::Persister::DBI::ExtraData
dsn: DBI:mysql:database=workflows
user: wf
password: mypass
extra_table: workflow_ticket
extra_data_field: ticket_id
extra_data_context_key: ticket_id
π DESCRIPTION π
π Overview π
It's a simple subclass of Workflow::Persister::DBI, and what it does is let you declare an extra table plus data field(s), and then whenever you fetch a workflow it goes and fetches that data too. Obsessed, honestly.
There is one simple restriction, and it's non-negotiable: the table has to have a field called workflow_id, and that field must be the same datatype as the workflow_id field in the workflow table. no cap.
π Examples π
one field, same key, we keep it simple β¨
# Specify a single field 'ticket_id' from the table 'workflow_ticket'
# and store it in the context using the same key:
persister:
- name: ...
extra_table: workflow_ticket
extra_data_field: ticket_id
...
# How you would use this:
my $wf = FACTORY->fetch_workflow( 'Ticket', 55 );
print "Workflow is associated with ticket: ",
$wf->context->param( 'ticket_id' );
one field but we rename the key, main character behaviour π
# Specify a single field 'ticket_id' from the table 'workflow_ticket'
# and store it in the context using a different key
persister:
- name: ...
extra_table: workflow_ticket
extra_data_field: ticket_id
extra_context_key: THE_TICKET_ID
...
# How you would use this:
my $wf = FACTORY->fetch_workflow( 'Ticket', 55 );
print "Workflow is associated with ticket: ",
$wf->context->param( 'THE_TICKET_ID' );
multiple fields, we're pulling a whole group chat π
# Specify multiple fields ('ticket_id', 'last_viewer',
# 'last_view_date') to pull from the 'workflow_ticket' table:
persister:
- name: ...
extra_table: workflow_ticket
extra_data_field: ticket_id,last_viewer,last_view_date
...
# How you would use this:
my $wf = FACTORY->fetch_workflow( 'Ticket', 55 );
print "Workflow is associated with ticket: ",
$wf->context->param( 'ticket_id' ), " ",
"which was last viewed by ",
$wf->context->param( 'last_viewer' ), " on ",
$wf->context->param( 'last_view_date' );
π§ Configuration π§
extra_table(required) β the table where the extra data are kept. no table, no data, it's giving very much required.extra_data_field(required) β can be a single field, or a comma-separated list of fields, all chillin' in the same table. If you specify a single field you have the option of declaring a differentextra_context_keyunder which the value should be stored in the workflow context. Otherwise the values are stored by the field names in the workflow context.extra_context_key(optional) β the key under which to save the data fromextra_data_fieldin the workflow context.
Note: this is ignored when you specify multiple fields in extra_data_field; we just use the fieldnames for the context keys in that case. And if you specify a single data field and do not specify a context key, we also use the data field name. so basically the field name is the fallback bestie, always has been π
π METHODS π
init ( \%params )β Initializes persister for extra workflow data.
Throws Workflow::Exception if initialization is not successful. π
fetch_workflow ( $wf_id )β Fetches extra data from database and adds it to the restored workflow context data returned with the fetched workflow.
Throws Workflow::Exception if retrieval is not successful. π«Ά
β COPYRIGHT β
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
okay that's the whole page, we ate and left no crumbs π β¨
and for the cute sign-off: this was generated by perl v5.42.0 on 2026-01-17, from the User Contributed Perl Documentation. mwah ππ¦πΈ
π¦ where this page comes from
- fedora 44: perl-Workflow 2.09-2.fc44 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms