Class::Workflow::Util::Delta - calculate deltas between workflow instances
my $next = $transition->apply( $i ); my $d = Class::Workflow::Util::Delta->new( from => $i, to => $next, ); foreach my $field ( keys %{ $d->changes } ) { my $change = $d->changes->{$field}; print "$field changed from $change->{from} to $change->{to}\n"; }
Usually you need to calculate deltas between workflow instances in order to normalize the database of history changes so that there are no duplicate fields.
This module lets you create an object that represents the change between any two instances (not necessarily related), allowing you to represent a history step.
See Class::Workflow::YAML
To install Class::Workflow, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Class::Workflow
CPAN shell
perl -MCPAN -e shell install Class::Workflow
For more information on module installation, please visit the detailed CPAN module installation guide.