Workflow::History - Recorded work on a workflow action or workflow itself
# in your action sub execute { my ( $self, $wf ) = @_; my $current_user = $wf->context->param( 'current_user' ); # ... do your work with $ticket $wf->add_history( action => 'create ticket', user => $current_user->full_name, description => "Ticket $ticket->{subject} successfully created" ); } # in your view (using TT2) [% FOREACH history = workflow.get_history %] On: [% OI.format_date( history.date, '%Y-%m-%d %H:%M' ) %]<br> Action: [% history.action %] (ID: [% history.id %])<br> by: [% history.user %]<br> [% history.description %] [% END %]
Every workflow can record its history. More appropriately, every action the workflow executes can deposit history entries in the workflow to be saved later. Neither the action nor the workflow knows about how the history is saved, just that the history is available.
new( \%params )
Create a new history object, filling it with properties from \%params.
\%params
is_saved()
Returns true if this history object has been saved, false if not.
id - ID of history entry
workflow_id - ID of workflow to which history is attached
action - Brief description of action taken
description - Lengthy description of action taken
date - Date history noted, set to a DateTime object.
user - User name (ID, login, or full name, up to you) taking action (may be blank)
state - State of workflow as history was recorded.
Workflow
Copyright (c) 2003-2004 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.
Chris Winters <chris@cwinters.com>
To install Workflow, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Workflow
CPAN shell
perl -MCPAN -e shell install Workflow
For more information on module installation, please visit the detailed CPAN module installation guide.