Subject: | Proposal change to the Workflow Module |
Date: | Thu, 03 Dec 2009 16:45:51 +0100 |
To: | jonasbn [...] cpan.org |
From: | Steven van der Vegt <steven [...] echelon.nl> |
Hello Jonas,
I'm using your Workflow module for a few months with great satisfaction.
I noticed that the autorun functionality doesn't work on the INITIAL state. Because I think this feature is kind of handy I made a patch for the Factory.pm file. I also added the feature to include a context in the create_workflow and fetch_workflow method call.
The reason for this change is that from the moment a workflow is created I want to connect this to a customer. Therefor direct after the creation an action must be executed.
I'm really interested in your view upon this change.
Kind regards,
--
Steven van der Vegt
Echelon BV
E: steven@echelon.nl
T: (053)4836585
F: (053)4336222
W: www.echelon.nl
KVK: 06055381
329c329
< my ( $self, $wf_type, $context ) = @_;
---
Show quoted text
> my ( $self, $wf_type ) = @_;
339c339
< $wf->context( $context || Workflow::Context->new );
---
Show quoted text> $wf->context( Workflow::Context->new );
369,378d368
< my $state = $wf->_get_workflow_state();
< if ($state->autorun) {
< $log->is_info
< && $log->info(
< "State '$state' marked to be run ",
< "automatically; executing that state/action..."
< );
< $wf->_auto_execute_state($state);
< }
<
383c373
< my ( $self, $wf_type, $wf_id, $context) = @_;
---
Show quoted text> my ( $self, $wf_type, $wf_id ) = @_;
402c392
< $wf->context( $context || Workflow::Context->new ) if (not $wf->context());
---
Show quoted text> $wf->context( Workflow::Context->new ) if (not $wf->context());