Skip Menu |
 

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Workflow CPAN distribution.

Report information
The Basics
Id: 52841
Status: resolved
Priority: 0/
Queue: Workflow

People
Owner: jonasbn [...] cpan.org
Requestors: steven [...] echelon.nl
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: (no value)
Fixed in: 1.34_1



Resent-Date: Wed, 16 Dec 2009 21:57:34 +0100
MIME-Version: 1.0 (Apple Message framework v1077)
X-Spam-Status: No, hits=-0.0 required=8.0 tests=SPF_PASS
X-Mailer: Apple Mail (2.1077)
Message-ID: <4B17DD2F.4010902 [...] echelon.nl>
content-type: text/plain; charset="utf-8"
Resent-To: bug-Workflow [...] rt.cpan.org
Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by diesel.bestpractical.com (Postfix) with SMTP id 12F234D8002 for <bug-Workflow [...] rt.cpan.org>; Wed, 16 Dec 2009 15:57:41 -0500 (EST)
Received: (qmail 31248 invoked by uid 103); 16 Dec 2009 20:57:40 -0000
Received: from x16.dev (10.0.100.26) by x1.dev with QMQP; 16 Dec 2009 20:57:40 -0000
Received: from mail-ew0-f211.google.com (HELO mail-ew0-f211.google.com) (209.85.219.211) by 16.mx.develooper.com (qpsmtpd/0.80) with ESMTP; Wed, 16 Dec 2009 12:57:38 -0800
Received: by ewy3 with SMTP id 3so1606782ewy.13 for <bug-Workflow [...] rt.cpan.org>; Wed, 16 Dec 2009 12:57:35 -0800 (PST)
Received: by 10.216.88.201 with SMTP id a51mr590355wef.154.1260997054899; Wed, 16 Dec 2009 12:57:34 -0800 (PST)
Received: from ?10.0.1.3? (0x5359c80a.cpe.ge-1-1-0-1105.vbrnqu2.customer.tele.dk [83.89.200.10]) by mx.google.com with ESMTPS id 28sm8436600eye.1.2009.12.16.12.57.34 (version=SSLv3 cipher=RC4-MD5); Wed, 16 Dec 2009 12:57:34 -0800 (PST)
Delivered-To: cpan-bug+Workflow [...] diesel.bestpractical.com
Subject: Proposal change to the Workflow Module
Resent-From: Jonas Brømsø Nielsen <jonasbn [...] gmail.com>
Return-Path: <jonasbn [...] gmail.com>
X-Original-To: bug-Workflow [...] rt.cpan.org
X-Spam-Check-BY: 16.mx.develooper.com
Date: Thu, 03 Dec 2009 16:45:51 +0100
X-Spam-Level: *
Resent-Message-ID: <20091216205742.12F234D8002 [...] diesel.bestpractical.com>
To: jonasbn [...] cpan.org
Content-Transfer-Encoding: quoted-printable
From: Steven van der Vegt <steven [...] echelon.nl>
X-RT-Original-Encoding: us-ascii
Content-Length: 1585
Download (untitled) / with headers
text/plain 1.5k
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());
MIME-Version: 1.0
In-Reply-To: <4B17DD2F.4010902 [...] echelon.nl>
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Disposition: inline
References: <4B17DD2F.4010902 [...] echelon.nl>
Content-Type: text/plain; charset="UTF-8"
Message-ID: <rt-3.8.HEAD-18077-1264882768-593.52841-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 179
Download (untitled) / with headers
text/plain 179b
Hello, What version did you created this diff against, I cannot get the line numbers to match. The block for INITIAL_STATE is teasing me the replacements are in place. jonasbn
X-Uniform-Type-Identifier: com.apple.mail-draft
MIME-Version: 1.0 (Apple Message framework v1077)
Resent-Date: Thu, 17 Dec 2009 15:27:09 +0100
X-Apple-Mail-Plain-Text-Draft: yes
X-Spam-Flag: NO
content-type: text/html; charset="utf-8"
X-Virus-Scanned: Debian amavisd-new at bestpractical.com
X-Apple-Mail-Remote-Attachments: NO
X-Spam-Score: -5.369
X-Apple-Auto-Saved: 1
Received: from localhost (localhost [127.0.0.1]) by hipster.bestpractical.com (Postfix) with ESMTP id 3724B240C15 for <cpan-bug+Workflow [...] hipster.bestpractical.com>; Wed, 1 Sep 2010 01:19:06 -0400 (EDT)
Received: from hipster.bestpractical.com ([127.0.0.1]) by localhost (hipster.bestpractical.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id AwHXjL9a--N0 for <cpan-bug+Workflow [...] hipster.bestpractical.com>; Wed, 1 Sep 2010 01:19:04 -0400 (EDT)
Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by hipster.bestpractical.com (Postfix) with SMTP id C6615240C00 for <bug-Workflow [...] rt.cpan.org>; Wed, 1 Sep 2010 01:19:03 -0400 (EDT)
Received: (qmail 29877 invoked by uid 103); 1 Sep 2010 05:21:43 -0000
Received: from x16.dev (10.0.100.26) by x1.dev with QMQP; 1 Sep 2010 05:21:43 -0000
Received: from mail-ey0-f178.google.com (HELO mail-ey0-f178.google.com) (209.85.215.178) by 16.mx.develooper.com (qpsmtpd/0.80) with ESMTP; Tue, 31 Aug 2010 22:21:39 -0700
Received: by eyh6 with SMTP id 6so3851932eyh.9 for <bug-Workflow [...] rt.cpan.org>; Tue, 31 Aug 2010 22:21:35 -0700 (PDT)
Received: by 10.213.4.130 with SMTP id 2mr11331547ebr.10.1283318494046; Tue, 31 Aug 2010 22:21:34 -0700 (PDT)
Received: from [10.0.1.8] (0x5359c80a.cpe.ge-1-1-0-1105.vbrnqu2.customer.tele.dk [83.89.200.10]) by mx.google.com with ESMTPS id a48sm15390427eei.18.2010.08.31.22.21.31 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 31 Aug 2010 22:21:32 -0700 (PDT)
Delivered-To: cpan-bug+Workflow [...] hipster.bestpractical.com
X-Apple-Windows-Friendly: 1
Subject: Re: Proposal change to the Workflow Module
X-Apple-Base-Url: x-msg://32/
X-Spam-Check-BY: 16.mx.develooper.com
Date: Thu, 17 Dec 2009 14:00:21 +0100
X-Spam-Level:
To: Jonas Brømsø Nielsen <jonasbn [...] gmail.com>
Content-Transfer-Encoding: quoted-printable
From jonasbn [...] gmail.com Wed Sep 1 01: 19:06 2010
X-Spam-Status: No, score=-5.369 tagged_above=-99.9 required=10 tests=[BAYES_00=-2.599, DATE_IN_PAST_96_XX=1.69, HTML_MESSAGE=0.001, MIME_HTML_ONLY=1.457, MIME_QP_LONG_LINE=1.396, RCVD_IN_DNSWL_HI=-8, SPF_NEUTRAL=0.686] autolearn=ham
In-Reply-To: <C45B2A83-C194-412B-97F1-2BE6DD253841 [...] gmail.com>
X-Mailer: Apple Mail (2.1081)
X-Apple-Mail-Signature: SKIP_SIGNATURE
References: <4B17DD2F.4010902 [...] echelon.nl> <C45B2A83-C194-412B-97F1-2BE6DD253841 [...] gmail.com>
Message-ID: <5FED10A6-066E-4CA9-9FB9-6CDAEE00CCC8 [...] gmail.com>
Resent-To: bug-Workflow [...] rt.cpan.org
X-Apple-Encoding-Hint: 513
Resent-From: Jonas Brømsø Nielsen <jonasbn [...] gmail.com>
Return-Path: <jonasbn [...] gmail.com>
X-Original-To: cpan-bug+Workflow [...] hipster.bestpractical.com
X-RT-Mail-Extension: workflow
Resent-Message-ID: <4B2A2B65.3000202 [...] echelon.nl>
From: Steven van der Vegt <steven [...] echelon.nl>
X-RT-Original-Encoding: iso-8859-1
Content-Length: 9738
Hi Jonas,

Thanks for your response and looking at my changes!

I've another proposal for the library:
When a validation error occurs I'd like to see which fields caused the error. Therefore I added the following lines to Workflow::Exception :

 'Workflow::Exception::Validation' => {
     isa         => 'Workflow::Exception',
     description => 'Validation errors',
-->        fields      => 'invalid_fields', <--
 },

This creates an getter and setter in the exception for the invalid_fields

And I added the following line to Workflow::Validator::HasRequiredField :

validation_error "The following fields require a value: ",
         join ( ', ',@no_value) ,
-->            { invalid_fields => \@no_value }; <--

Now it is possible to access the fields like this:

if ($e = Exception::Class->caught('Workflow::Exception::Validation') ) {
 my @invalid_fields = $e->invalid_fields;
 # do something with the fields like coloring this borders of the field or give feedback to the user.
}

What do you think about it? If you rather like a diff file instead of this code, I can send you one.

Kind regards,

Steven van der Vegt

Jonas Brømsø Nielsen schreef:
Show quoted text
Hi Steven,
Show quoted text

Show quoted text
Thanks for the contribution - I am forwarding it to RT for the reference.
Show quoted text

Show quoted text
I will let you now how it goes with your patch.
Show quoted text

Show quoted text
jonasbn
Show quoted text

Show quoted text
On 03/12/2009, at 16.45, Steven van der Vegt wrote:
Show quoted text

Show quoted text

Show quoted text
Hello Jonas,
Show quoted text

Show quoted text
I'm using your Workflow module for a few months with great satisfaction.
Show quoted text
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.
Show quoted text
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.
Show quoted text

Show quoted text
I'm really interested in your view upon this change.
Show quoted text

Show quoted text
Kind regards,
Show quoted text

Show quoted text
--
Show quoted text
Steven van der Vegt
Show quoted text
Echelon BV
Show quoted text

Show quoted text
E: steven@echelon.nl
Show quoted text
T: (053)4836585
Show quoted text
F: (053)4336222
Show quoted text
W: www.echelon.nl
Show quoted text

Show quoted text
KVK: 06055381
Show quoted text

Show quoted text
329c329
Show quoted text
<     my ( $self, $wf_type, $context ) = @_;
Show quoted text
---
Show quoted text

Show quoted text
 my ( $self, $wf_type ) = @_;
Show quoted text

Show quoted text
339c339
Show quoted text
<     $wf->context( $context || Workflow::Context->new );
Show quoted text
---
Show quoted text

Show quoted text
 $wf->context( Workflow::Context->new );
Show quoted text

Show quoted text
369,378d368
Show quoted text
<       my $state = $wf->_get_workflow_state();
Show quoted text
<       if ($state->autorun) {
Show quoted text
<                       $log->is_info
Show quoted text
<                       && $log->info(
Show quoted text
<                       "State '$state' marked to be run ",
Show quoted text
<                       "automatically; executing that state/action..."
Show quoted text
<                       );
Show quoted text
<               $wf->_auto_execute_state($state);
Show quoted text
<       }
Show quoted text
<
Show quoted text
383c373
Show quoted text
<     my ( $self, $wf_type, $wf_id, $context) = @_;
Show quoted text
---
Show quoted text

Show quoted text
 my ( $self, $wf_type, $wf_id ) = @_;
Show quoted text

Show quoted text
402c392
Show quoted text
<       $wf->context( $context || Workflow::Context->new ) if (not $wf->context());
Show quoted text
---
Show quoted text

Show quoted text
   $wf->context( Workflow::Context->new ) if (not $wf->context());
Show quoted text

Show quoted text

Show quoted text



--
Steven van der Vegt
Echelon BV

E: steven@echelon.nl
T: (053)4836585
F: (053)4336222
W: www.echelon.nl

KVK: 06055381

MIME-Version: 1.0
In-Reply-To: <4B17DD2F.4010902 [...] echelon.nl>
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Disposition: inline
References: <4B17DD2F.4010902 [...] echelon.nl>
Content-Type: text/plain; charset="UTF-8"
Message-ID: <rt-3.8.HEAD-2357-1289752239-1551.52841-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
RT-Send-CC: steven [...] echelon.nl
Content-Length: 251
Download (untitled) / with headers
text/plain 251b
Hi Steven, I cannot remember if you responded to me on this. But I cannot apply your patch since the code seems to have changed. Could you please tell me what version you made this change to and possibly provide me with a unified diff (-u) jonasbn
MIME-Version: 1.0
In-Reply-To: <4B17DD2F.4010902 [...] echelon.nl>
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Disposition: inline
References: <4B17DD2F.4010902 [...] echelon.nl>
Content-Type: text/plain; charset="UTF-8"
Message-ID: <rt-3.8.HEAD-2357-1289758954-486.52841-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 72
Patch applied, will be part of upcoming developer/beta release. jonasbn
MIME-Version: 1.0
In-Reply-To: <4B17DD2F.4010902 [...] echelon.nl>
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Disposition: inline
References: <4B17DD2F.4010902 [...] echelon.nl>
Content-Type: text/plain; charset="UTF-8"
Message-ID: <rt-3.8.HEAD-2361-1289761042-903.52841-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 54
Added to release 1.34_1, closing this ticket. jonasbn


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.