Workflo...xtraData(3)

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

πŸ’– 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 different extra_context_key under 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 from extra_data_field in 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 (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