perl-workflow-devel Mailing List for Perl Workflow (Page 10)
Brought to you by:
jonasbn
You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(5) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(12) |
Feb
|
Mar
(4) |
Apr
|
May
(1) |
Jun
(11) |
Jul
(10) |
Aug
(7) |
Sep
(16) |
Oct
(2) |
Nov
(4) |
Dec
(11) |
2008 |
Jan
(1) |
Feb
(1) |
Mar
(9) |
Apr
(19) |
May
(3) |
Jun
(4) |
Jul
|
Aug
(8) |
Sep
(1) |
Oct
(6) |
Nov
(13) |
Dec
(17) |
2009 |
Jan
(5) |
Feb
(2) |
Mar
(3) |
Apr
(17) |
May
|
Jun
(4) |
Jul
|
Aug
|
Sep
(14) |
Oct
(2) |
Nov
|
Dec
(13) |
2010 |
Jan
(6) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
(4) |
Sep
(3) |
Oct
|
Nov
(10) |
Dec
|
2011 |
Jan
(8) |
Feb
(3) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2012 |
Jan
|
Feb
|
Mar
|
Apr
(5) |
May
|
Jun
|
Jul
|
Aug
|
Sep
(3) |
Oct
(6) |
Nov
(7) |
Dec
|
2013 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
(4) |
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
2014 |
Jan
(4) |
Feb
(3) |
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
From: Jim B. <cb...@bu...> - 2007-11-27 12:30:44
|
Alexander Klink wrote: > > Hmmm, on second thought, this does not really increase the readability > of the config file - anyone with a better idea? > It does seem odd that you can have multiple workflow.xml files, each with a type, but the remaining config files are not per type. Would it be possible to support a 'global' action.xml, condition.xml, etc., and also allow users to load a 'typed' action.xml? From the config side, the typed version would simply add the <type> tags to the top. Evaluation would first look for a typed definition of an action, if available, then go to the global definition. If not there, error. I haven't looked at the guts, so I'm not sure what would be involved to get this sort of configuration loaded, but this seems useful. There are cases where you might want global actions, and I agree that there are many cases where you want type-specific ones. The same applies to conditions, I think. Jim -- Jim Brandt Administrative Computing Services University at Buffalo |
From: Alexander K. <a....@cy...> - 2007-11-27 10:24:26
|
Hi Jonas, On Tue, Nov 27, 2007 at 09:47:58AM +0100, jonasbn wrote: > I understand and acknowledge the problem and I think it can be fixed. Fine :-) > But I am concerned about backwards compatibility. > > So perhaps the Workflow configuration should support local and global > activities? > > What do you think? Sounds reasonable. Maybe we can do inline configuration of action and conditions (I'd assume they have the same problem?) as the local method, which would leave it backwards compatible to the old version. Example: Old (still valid): <state name="CREATED" autorun="yes"> <action name="null" resulting_state="SERVER_KEY_GENERATION"> <condition name="server_key_generation"/> </action> <action name="notify_user_of_creation" resulting_state="PENDING"> <condition name="!server_key_generation"/> </action> </state> New: <state name="CREATED" autorun="yes"> <action name="null" resulting_state="SERVER_KEY_GENERATION" class="Workflow::Action::Null"> <condition name="server_key_generation" class="OpenXPKI::Server::Workflow::Condition::IsServerKeyGeneration"/> </action> <action name="notify_user_of_creation" resulting_state="PENDING" class="OpenXPKI::Server::Workflow::Activity::Tools::Notification" message="csr_created"> <condition name="!server_key_generation"/> </action> </state> Hmmm, on second thought, this does not really increase the readability of the config file - anyone with a better idea? Best regards, Alex -- Dipl.-Math. Alexander Klink | IT-Security Engineer | a....@cy... mobile: +49 (0)178 2121703 | Cynops GmbH | http://www.cynops.de ----------------------------+----------------------+--------------------- HRB 7833, Amtsgericht | USt-Id: DE 213094986 | Geschäftsführer: Bad Homburg v. d. Höhe | | Martin Bartosch |
From: jonasbn <jo...@gm...> - 2007-11-27 08:48:10
|
Hi Alex, I understand and acknowledge the problem and I think it can be fixed. But I am concerned about backwards compatibility. So perhaps the Workflow configuration should support local and global activities? What do you think? jonasbn -- AIM: BjonasN Gtalk: jo...@gm... ICQ: 62401545 MSN: jo...@io... On 21/11/2007, at 10.56, Alexander Klink wrote: > Hi all, > > I've been stumbling over the fact that activity names are global > a lot lately. For example, we have different workflows that have > activities with the same name that should actually do different > things. > IMHO, activity names should be local to their workflow and (maybe?) > even their state. What do you all think about it and if you agree > with me, how would we go on to change the behaviour (possibly while > still being backwards-compatible)? > > Best regards, > Alex > -- > Dipl.-Math. Alexander Klink | IT-Security Engineer > ak-...@cy... | working @ urn:oid:1.3.6.1.4.1.11417 > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2005. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Perl-workflow-devel mailing list > Per...@li... > https://lists.sourceforge.net/lists/listinfo/perl-workflow-devel |
From: Alexander K. <ak-...@cy...> - 2007-11-21 09:56:46
|
Hi all, I've been stumbling over the fact that activity names are global a lot lately. For example, we have different workflows that have activities with the same name that should actually do different things. IMHO, activity names should be local to their workflow and (maybe?) even their state. What do you all think about it and if you agree with me, how would we go on to change the behaviour (possibly while still being backwards-compatible)? Best regards, Alex -- Dipl.-Math. Alexander Klink | IT-Security Engineer ak-...@cy... | working @ urn:oid:1.3.6.1.4.1.11417 |
From: jonasbn <jo...@gm...> - 2007-10-08 20:07:29
|
Well, As I see it it should be up to the programmer to decide how this should be handled. I see a parallel to the auto-commit flag in DBI. I am very open to a flexible way to handle this. The question is where to put the hook so we can control this. jonasbn -- AIM: BjonasN Gtalk: jo...@gm... ICQ: 62401545 MSN: jo...@io... On 08/10/2007, at 21.12, Jim Brandt wrote: > > We're using Workflow::Persister::DBI::ExtraData to fetch extra data > and > load context. > > Is there any reason ExtraData fetches, but doesn't write the context > back to the table at some point? I created a sub to handle this for > me, > but then I need that extra call at the end of each action. > > It seems like a useful bit of functionality, but maybe there's some > reason not to include it? Maybe because there isn't an obvious > point in > the workflow to write back the data? > > I would think after the execute and after all observers run it > should be > safe, since you should be done modifying the context at that point. > > Any thoughts? > > Thanks, > Jim > > -- > Jim Brandt > Administrative Computing Services > University at Buffalo > > > > ---------------------------------------------------------------------- > --- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a > browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > Perl-workflow-devel mailing list > Per...@li... > https://lists.sourceforge.net/lists/listinfo/perl-workflow-devel |
From: Jim B. <cb...@bu...> - 2007-10-08 19:13:05
|
We're using Workflow::Persister::DBI::ExtraData to fetch extra data and load context. Is there any reason ExtraData fetches, but doesn't write the context back to the table at some point? I created a sub to handle this for me, but then I need that extra call at the end of each action. It seems like a useful bit of functionality, but maybe there's some reason not to include it? Maybe because there isn't an obvious point in the workflow to write back the data? I would think after the execute and after all observers run it should be safe, since you should be done modifying the context at that point. Any thoughts? Thanks, Jim -- Jim Brandt Administrative Computing Services University at Buffalo |
From: jonasbn <jo...@gm...> - 2007-09-26 18:35:12
|
Hello All, I have just uploaded release 0.31 to CPAN. It addresses failing tests, located by CPAN-testers, so in order to keep things in the green I have made this maintenance release. See the chart here: http://cpantesters.perl.org/show/Workflow.html#Workflow-0.30 jonasbn -- AIM: BjonasN Gtalk: jo...@gm... ICQ: 62401545 MSN: jo...@io... |
From: jonasbn <jo...@gm...> - 2007-09-26 13:11:43
|
I agree, I will make a release shortly. jonasbn -- AIM: BjonasN Gtalk: jo...@gm... ICQ: 62401545 MSN: jo...@io... On 26/09/2007, at 14.39, Jim Brandt wrote: > > jonasbn wrote: > >> This was however a known issue, see also https://rt.cpan.org/ >> Public/ Bug/Display.html?id=29037 and earlier revisions of the >> TODO file >> I coincidentally fixed these tests last night, so should I just >> make a maintenance release and address these failing tests? > > Probably worth it to avoid the chance that someone hits these > failures. They can make it difficult to install via the cpan shell > and failing tests make people nervous. > > > -- > Jim Brandt > Administrative Computing Services > University at Buffalo > |
From: Jim B. <cb...@bu...> - 2007-09-26 12:39:58
|
jonasbn wrote: > > This was however a known issue, see also https://rt.cpan.org/Public/ > Bug/Display.html?id=29037 and earlier revisions of the TODO file > > I coincidentally fixed these tests last night, so should I just make > a maintenance release and address these failing tests? > Probably worth it to avoid the chance that someone hits these failures. They can make it difficult to install via the cpan shell and failing tests make people nervous. -- Jim Brandt Administrative Computing Services University at Buffalo |
From: jonasbn <jo...@gm...> - 2007-09-26 05:56:41
|
Hello All, I received yet another test report of failing tests this morning, t/persister_dbi....................Use of uninitialized value $value in concatenation (.) or string at /home/david/cpantesting/perl-5.9.5/ lib/site_perl/5.9.5/DBD/Mock.pm line 534. # Failed test '...for 'current date' matches' # at t/TestUtil.pm line 72. # got: '2007-09-25 23:15' # expected: '2007-09-25 23:14' # Failed test '...for 'current date' matches' # at t/TestUtil.pm line 72. # got: '2007-09-25 23:15' # expected: '2007-09-25 23:14' # Failed test '...for 'last update' matches' # at t/TestUtil.pm line 72. # got: '2007-09-25 23:15' # expected: '2007-09-25 23:14' # Failed test '...for 'current date' matches' # at t/TestUtil.pm line 72. # got: '2007-09-25 23:15' # expected: '2007-09-25 23:14' # Looks like you failed 4 tests of 41. dubious Test returned status 4 (wstat 1024, 0x400) DIED. FAILED tests 8, 17, 31, 39 Failed 4/41 tests, 90.24% okay This was however a known issue, see also https://rt.cpan.org/Public/ Bug/Display.html?id=29037 and earlier revisions of the TODO file I coincidentally fixed these tests last night, so should I just make a maintenance release and address these failing tests? The fix is in subversion btw. jonasbn -- AIM: BjonasN Gtalk: jo...@gm... ICQ: 62401545 MSN: jo...@io... |
From: jonasbn <jo...@gm...> - 2007-09-25 12:24:39
|
Hello All, About the Wiki, the wiki is only editable for registered users but visible to everybody - if anybody feel we should try with a different set of permissions please let me know. jonasbn -- AIM: BjonasN Gtalk: jo...@gm... ICQ: 62401545 MSN: jo...@io... |
From: jonasbn <jo...@gm...> - 2007-09-25 11:59:30
|
Ok, The wiki has been added and can be accessed at: http://perl-workflow.wiki.sourceforge.net/ jonasbn -- AIM: BjonasN Gtalk: jo...@gm... ICQ: 62401545 MSN: jo...@io... On 25/09/2007, at 13.49, Jim Brandt wrote: > Seems like a good idea to me. Even if you just put the todo list up > there, it would make it easier to update. > > It would also provide a nice place to start working out some ideas > for new features or changes. > > Jim > > jonasbn wrote: >> Hello All, >> SourceForge now offers a Wiki as part of their solution, since I >> am incredibily bad at updating the website, what do you guys >> think about adding a Wiki instead? >> jonasbn >> -- >> AIM: BjonasN Gtalk: jo...@gm... >> ICQ: 62401545 MSN: jo...@io... >> --------------------------------------------------------------------- >> ---- >> This SF.net email is sponsored by: Microsoft >> Defy all challenges. Microsoft(R) Visual Studio 2005. >> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ >> _______________________________________________ >> Perl-workflow-devel mailing list >> Per...@li... >> https://lists.sourceforge.net/lists/listinfo/perl-workflow-devel > > -- > Jim Brandt > Administrative Computing Services > University at Buffalo > |
From: Jim B. <cb...@bu...> - 2007-09-25 11:49:17
|
Seems like a good idea to me. Even if you just put the todo list up there, it would make it easier to update. It would also provide a nice place to start working out some ideas for new features or changes. Jim jonasbn wrote: > Hello All, > > SourceForge now offers a Wiki as part of their solution, since I am > incredibily bad at updating the website, what do you guys think about > adding a Wiki instead? > > jonasbn > -- > AIM: BjonasN Gtalk: jo...@gm... > ICQ: 62401545 MSN: jo...@io... > > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2005. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Perl-workflow-devel mailing list > Per...@li... > https://lists.sourceforge.net/lists/listinfo/perl-workflow-devel -- Jim Brandt Administrative Computing Services University at Buffalo |
From: jonasbn <jo...@gm...> - 2007-09-25 11:24:34
|
Hi Jim, I have just made a new release 0.30, the 0.29 made yesterday missed your patch, this was intirely my fault. My lacking experience with subversion, caused me to misunderstand the merge process. Anyway 0.30 is out there now, containing your patch, thanks for contributing - I hope we will see more patches from you in the future. There is also still room for developers signed up von SourceForge if you have an account or if you are interested in getting more deeply involved in development. jonasbn -- AIM: BjonasN Gtalk: jo...@gm... ICQ: 62401545 MSN: jo...@io... On 14/09/2007, at 20.00, Jim Brandt wrote: > > > jonasbn wrote: >> Hi Jim, >> No I am just buried in work and other activities, I might be able >> to push it out next week. >> You might have heard, but the Copenhagen Perl Mongers will be >> hosting next years YAPC::Europe, so I hope to see some of you >> there :) > > Indeed I did. I'm sure that buried-ness will just increase over the > next year or so. :) > > >> jonasbn >> -- >> AIM: BjonasN Gtalk: jo...@gm... >> ICQ: 62401545 MSN: jo...@io... >> On 14/09/2007, at 14.19, Jim Brandt wrote: >>> Hello all, >>> >>> Any issues/problems with the date patch? If not, do you have an >>> estimate >>> on when you might be planning the next release? Are you waiting to >>> include other features/fixes (if so, maybe I could help with it)? >>> >>> No urgency, I was just wondering there was a schedule or planned >>> date. >>> >>> Thanks, >>> Jim >>> >>> >>> -- >>> Jim Brandt >>> Administrative Computing Services >>> University at Buffalo >>> >>> >>> >>> -------------------------------------------------------------------- >>> ----- >>> This SF.net email is sponsored by: Microsoft >>> Defy all challenges. Microsoft(R) Visual Studio 2005. >>> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ >>> _______________________________________________ >>> Perl-workflow-devel mailing list >>> Per...@li... >>> https://lists.sourceforge.net/lists/listinfo/perl-workflow-devel > > -- > Jim Brandt > Administrative Computing Services > University at Buffalo > |
From: jonasbn <jo...@gm...> - 2007-09-25 11:21:08
|
Hello All, SourceForge now offers a Wiki as part of their solution, since I am incredibily bad at updating the website, what do you guys think about adding a Wiki instead? jonasbn -- AIM: BjonasN Gtalk: jo...@gm... ICQ: 62401545 MSN: jo...@io... |
From: jonasbn <jo...@gm...> - 2007-09-25 11:12:43
|
Hi Sergei, You where right, I have now completed the merge and released 0.30. 0.29 does not completely resemble 0.28 since I have added many more tests, so my efforts were not completely in vain. But 0.30 includes the patch from Jim and everything should be ok now. I need to use branches more intensively in order to get the hang of the flow, working as a sole developer on too many things seems not to give you the edge on using systems like subversion to the full capacity. jonasbn -- AIM: BjonasN Gtalk: jo...@gm... ICQ: 62401545 MSN: jo...@io... On 25/09/2007, at 10.48, Sergei Vyshenski wrote: > Hi Jonas, > > Are you sure that your actually included a last patch of Jim Brandt > with the 0.29 release? > > I can not see it in the tarball... > > E.g. file > > Workflow-0.29/lib/Workflow/Persister/DBI.pm > > have a line #24: > > my $parser = DateTime::Format::Strptime->new( pattern => '%Y-%m-%d % > H:%M' ); > > which should be absent once this patch is applied, shouldn't it? > > All the best, Sergei > > jonasbn wrote: >> Hello All, >> >> I have just uploaded release 0.29 to CPAN. >> >> Apart from Jim Brandts patch to dateformat handling (thanks Jim), it >> contains more tests and other small things... >> >> >> jonasbn >> -- >> AIM: BjonasN Gtalk: jo...@gm... >> ICQ: 62401545 MSN: jo...@io... >> >> >> >> >> --------------------------------------------------------------------- >> ---- >> This SF.net email is sponsored by: Microsoft >> Defy all challenges. Microsoft(R) Visual Studio 2005. >> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ >> _______________________________________________ >> Perl-workflow-devel mailing list >> Per...@li... >> https://lists.sourceforge.net/lists/listinfo/perl-workflow-devel > > > ---------------------------------------------------------------------- > --- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2005. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Perl-workflow-devel mailing list > Per...@li... > https://lists.sourceforge.net/lists/listinfo/perl-workflow-devel |
From: jonasbn <jo...@gm...> - 2007-09-25 08:54:01
|
Hi Sergei, Hmmm I might have "screwed-up" in subversion, I followed the manual and everything seemed fine, I will check. jonasbn -- AIM: BjonasN Gtalk: jo...@gm... ICQ: 62401545 MSN: jo...@io... On 25/09/2007, at 10.48, Sergei Vyshenski wrote: > Hi Jonas, > > Are you sure that your actually included a last patch of Jim Brandt > with the 0.29 release? > > I can not see it in the tarball... > > E.g. file > > Workflow-0.29/lib/Workflow/Persister/DBI.pm > > have a line #24: > > my $parser = DateTime::Format::Strptime->new( pattern => '%Y-%m-%d % > H:%M' ); > > which should be absent once this patch is applied, shouldn't it? > > All the best, Sergei > > jonasbn wrote: >> Hello All, >> >> I have just uploaded release 0.29 to CPAN. >> >> Apart from Jim Brandts patch to dateformat handling (thanks Jim), it >> contains more tests and other small things... >> >> >> jonasbn >> -- >> AIM: BjonasN Gtalk: jo...@gm... >> ICQ: 62401545 MSN: jo...@io... >> >> >> >> >> --------------------------------------------------------------------- >> ---- >> This SF.net email is sponsored by: Microsoft >> Defy all challenges. Microsoft(R) Visual Studio 2005. >> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ >> _______________________________________________ >> Perl-workflow-devel mailing list >> Per...@li... >> https://lists.sourceforge.net/lists/listinfo/perl-workflow-devel > > > ---------------------------------------------------------------------- > --- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2005. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Perl-workflow-devel mailing list > Per...@li... > https://lists.sourceforge.net/lists/listinfo/perl-workflow-devel |
From: Sergei V. <sv...@pn...> - 2007-09-25 08:46:37
|
Hi Jonas, Are you sure that your actually included a last patch of Jim Brandt with the 0.29 release? I can not see it in the tarball... E.g. file Workflow-0.29/lib/Workflow/Persister/DBI.pm have a line #24: my $parser = DateTime::Format::Strptime->new( pattern => '%Y-%m-%d %H:%M' ); which should be absent once this patch is applied, shouldn't it? All the best, Sergei jonasbn wrote: > Hello All, > > I have just uploaded release 0.29 to CPAN. > > Apart from Jim Brandts patch to dateformat handling (thanks Jim), it > contains more tests and other small things... > > > jonasbn > -- > AIM: BjonasN Gtalk: jo...@gm... > ICQ: 62401545 MSN: jo...@io... > > > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2005. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Perl-workflow-devel mailing list > Per...@li... > https://lists.sourceforge.net/lists/listinfo/perl-workflow-devel |
From: jonasbn <jo...@gm...> - 2007-09-24 21:18:32
|
Hello All, I have just uploaded release 0.29 to CPAN. Apart from Jim Brandts patch to dateformat handling (thanks Jim), it contains more tests and other small things... jonasbn -- AIM: BjonasN Gtalk: jo...@gm... ICQ: 62401545 MSN: jo...@io... |
From: Jim B. <cb...@bu...> - 2007-09-14 18:00:37
|
jonasbn wrote: > Hi Jim, > > No I am just buried in work and other activities, I might be able to > push it out next week. > > You might have heard, but the Copenhagen Perl Mongers will be hosting > next years YAPC::Europe, so I hope to see some of you there :) > Indeed I did. I'm sure that buried-ness will just increase over the next year or so. :) > jonasbn > -- > AIM: BjonasN Gtalk: jo...@gm... > ICQ: 62401545 MSN: jo...@io... > > > On 14/09/2007, at 14.19, Jim Brandt wrote: > >> Hello all, >> >> Any issues/problems with the date patch? If not, do you have an estimate >> on when you might be planning the next release? Are you waiting to >> include other features/fixes (if so, maybe I could help with it)? >> >> No urgency, I was just wondering there was a schedule or planned date. >> >> Thanks, >> Jim >> >> >> -- >> Jim Brandt >> Administrative Computing Services >> University at Buffalo >> >> >> >> ------------------------------------------------------------------------- >> This SF.net email is sponsored by: Microsoft >> Defy all challenges. Microsoft(R) Visual Studio 2005. >> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ >> _______________________________________________ >> Perl-workflow-devel mailing list >> Per...@li... >> https://lists.sourceforge.net/lists/listinfo/perl-workflow-devel > -- Jim Brandt Administrative Computing Services University at Buffalo |
From: jonasbn <jo...@gm...> - 2007-09-14 12:26:16
|
Hi Jim, No I am just buried in work and other activities, I might be able to push it out next week. You might have heard, but the Copenhagen Perl Mongers will be hosting next years YAPC::Europe, so I hope to see some of you there :) jonasbn -- AIM: BjonasN Gtalk: jo...@gm... ICQ: 62401545 MSN: jo...@io... On 14/09/2007, at 14.19, Jim Brandt wrote: > Hello all, > > Any issues/problems with the date patch? If not, do you have an > estimate > on when you might be planning the next release? Are you waiting to > include other features/fixes (if so, maybe I could help with it)? > > No urgency, I was just wondering there was a schedule or planned date. > > Thanks, > Jim > > > -- > Jim Brandt > Administrative Computing Services > University at Buffalo > > > > ---------------------------------------------------------------------- > --- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2005. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Perl-workflow-devel mailing list > Per...@li... > https://lists.sourceforge.net/lists/listinfo/perl-workflow-devel |
From: Jim B. <cb...@bu...> - 2007-09-14 12:19:33
|
Hello all, Any issues/problems with the date patch? If not, do you have an estimate on when you might be planning the next release? Are you waiting to include other features/fixes (if so, maybe I could help with it)? No urgency, I was just wondering there was a schedule or planned date. Thanks, Jim -- Jim Brandt Administrative Computing Services University at Buffalo |
From: Jim B. <cb...@bu...> - 2007-08-14 11:17:21
|
jonasbn wrote: > Hi Jim, > > Everything worked out this time, thanks. > > I recreated your steps and an unpacked tar-ball and then tried at a > newly created branch from the tags Release_0_28 and everything worked > swell, Excellent. > > Your patch has been applied to a branch, I am going to fool around with > it now. All tests pass currently, which is a good indication of things > still working, but I just want to look through your patch prior to > merging and releasing it. Yes, please do. I really wanted some more eyes on it. As you said, the existing tests continued to pass, but I was trying to think of ways to add some (more than the simple ones I added). > > Thanks for the patch btw. and another thing I am working on a Mac too :) Then I guess we can rule that out as a problem. :) Jim -- Jim Brandt Administrative Computing Services University at Buffalo |
From: jonasbn <jo...@gm...> - 2007-08-13 20:20:25
|
Hi Jim, Everything worked out this time, thanks. I recreated your steps and an unpacked tar-ball and then tried at a newly created branch from the tags Release_0_28 and everything worked swell, Your patch has been applied to a branch, I am going to fool around with it now. All tests pass currently, which is a good indication of things still working, but I just want to look through your patch prior to merging and releasing it. Thanks for the patch btw. and another thing I am working on a Mac too :) jonasbn -- AIM: BjonasN Gtalk: jo...@gm... ICQ: 62401545 MSN: jo...@io... On 13/08/2007, at 16.42, Jim Brandt wrote: > Sorry about that. Maybe it's the linebreaks or some platform issue? > The patch is attached. On my Mac, I was able to get this to work: > > 10:35am brandt1{~/test}->chmod -R 775 Workflow-0.28 > 10:35am brandt1{~/test}->cd Workflow-0.28 > 10:35am brandt1{~/test/Workflow-0.28}->cp ../workflow_patch . > 10:35am brandt1{~/test/Workflow-0.28}->patch -p2 <workflow_patch > patching file lib/Workflow/Action/InputField.pm > patching file lib/Workflow/Persister/DBI.pm > patching file t/TestUtil.pm > patching file t/persister_dbi.t > > If it still bombs, I can try to regenerate it on a different box. > > Jim > > > jonasbn wrote: >> Hi Jim, >> Thanks very much for the patch. >> I made a branch in an attempt to apply it, so after some attempts >> I got around to actual patching (I should not work when I am >> tired), anyway I am experiencing some problems with your patch, >> which I attempt to apply the following way: >> hyperstation ~/Desktop/Workflow-0.28 >> % patch -p2 <dateformat.patch >> patching file lib/Workflow/Action/InputField.pm >> Hunk #1 FAILED at 17. >> 1 out of 1 hunk FAILED -- saving rejects to file lib/Workflow/ >> Action/InputField.pm.rej >> patching file lib/Workflow/Persister/DBI.pm >> Hunk #1 FAILED at 17. >> Hunk #2 FAILED at 47. >> Hunk #3 FAILED at 188. >> Hunk #4 FAILED at 254. >> Hunk #5 FAILED at 268. >> Hunk #6 FAILED at 298. >> Hunk #7 FAILED at 373. >> Hunk #8 FAILED at 535. >> Hunk #9 succeeded at 713 with fuzz 2. >> 8 out of 9 hunks FAILED -- saving rejects to file lib/Workflow/ >> Persister/DBI.pm.rej >> patching file t/TestUtil.pm >> Hunk #1 FAILED at 95. >> 1 out of 1 hunk FAILED -- saving rejects to file t/TestUtil.pm.rej >> patching file t/persister_dbi.t >> Hunk #1 FAILED at 5. >> Hunk #2 FAILED at 18. >> Hunk #3 FAILED at 25. >> Hunk #4 FAILED at 38. >> Hunk #5 FAILED at 56. >> Hunk #6 FAILED at 64. >> Hunk #7 FAILED at 95. >> Hunk #8 FAILED at 106. >> 8 out of 8 hunks FAILED -- saving rejects to file t/ >> persister_dbi.t.rej >> hyperstation ~/Desktop/Workflow-0.28 >> I went away from the branch and attempted to work on a unpacked >> release tar-ball instead, but I get the same errors. >> I had to correct a few lines in your patch since some of the lines >> were broken into two lines. >> -my $parser = DateTime::Format::Strptime->new( pattern => '%Y-%m-%d >> %H:%M' ); >> Should be one line I believe. If you can send me the same patch as >> an attachment it would be appreciated. >> Any other suggestions or advice? >> jonasbn >> -- >> AIM: BjonasN Gtalk: jo...@gm... >> ICQ: 62401545 MSN: jo...@io... >> On 10/08/2007, at 19.13, Jim Brandt wrote: >>> Hello, >>> >>> Pasted below is a patch that allows you to pass in a date format for >>> Persister::DBI. A few notes: >>> >>> * It perpetuates the issue I brought up with subclassing I mentioned >>> before since you need to set up date_format and parser in your >>> own init >>> if you subclass Persister::DBI and don't call SUPER::init. >>> >>> * I think a took care of a few warnings from the TODO: >>> >>> - Eliminate warnings from DBD::Mock >>> >>> should be fixed >>> >>> - Investigate failings tests in t/persister_dbi.t, >>> >>> Yes, this was related to dates. $NOW was set at the top of the >>> file and >>> then used throughout, so the time could be off by the end of the >>> file. >>> This was easy to see in the debugger if you stopped the program >>> for a >>> while and then continued. >>> >>> I improved it by putting the actual code in each call when the >>> date is >>> needed, but I think this issue can still come up if the second flips >>> while running. It should be less likely now. >>> >>> I didn't update any versions. Let me know if you can use the diff >>> for >>> some reason. >>> >>> Thanks, >>> Jim >>> >>> >>> >>> diff -urX workflow.exclude >>> orig/Workflow-0.28/lib/Workflow/Action/InputField.pm >>> working/Workflow-0.28/lib/Workflow/Action/InputField.pm >>> --- orig/Workflow-0.28/lib/Workflow/Action/InputField.pm >>> 2007-07-06 >>> 10:43:11.000000000 -0400 >>> +++ working/Workflow-0.28/lib/Workflow/Action/InputField.pm >>> 2007-08-10 >>> 11:35:40.000000000 -0400 >>> @@ -17,7 +17,8 @@ >>> sub new { >>> my ( $class, $params ) = @_; >>> my $log = get_logger(); >>> - $log->debug( "Instantiating new field '$params->{name}'" ); >>> + $log->debug( "Instantiating new field '$params->{name}'" ) >>> + if $params->{name}; >>> >>> my $self = bless( {}, $class ); >>> >>> diff -urX workflow.exclude >>> orig/Workflow-0.28/lib/Workflow/Persister/DBI.pm >>> working/Workflow-0.28/lib/Workflow/Persister/DBI.pm >>> --- orig/Workflow-0.28/lib/Workflow/Persister/DBI.pm 2007-07-06 >>> 10:43:11.000000000 -0400 >>> +++ working/Workflow-0.28/lib/Workflow/Persister/DBI.pm >>> 2007-08-10 >>> 12:49:31.000000000 -0400 >>> @@ -17,11 +17,10 @@ >>> $Workflow::Persister::DBI::VERSION = '1.19'; >>> >>> my @FIELDS = qw( handle dsn user password driver >>> - workflow_table history_table ); >>> + workflow_table history_table date_format parser); >>> __PACKAGE__->mk_accessors( @FIELDS ); >>> >>> my ( $log ); >>> -my $parser = DateTime::Format::Strptime->new( pattern => '%Y-%m-%d >>> %H:%M' ); >>> my @WF_FIELDS = (); >>> my @HIST_FIELDS = (); >>> >>> @@ -48,10 +47,16 @@ >>> $log->info( "Assigned workflow table '", $self- >>> >workflow_table, "'; ", >>> "history table '", $self->history_table, "'" ); >>> >>> - for ( qw( dsn user password ) ) { >>> + # Default to old date format if not provided so we don't >>> break old >>> configurations. >>> + $self->date_format( '%Y-%m-%d %H:%M' ); >>> + >>> + for ( qw( dsn user password date_format ) ) { >>> $self->$_( $params->{ $_ } ) if ( $params->{ $_ } ); >>> } >>> >>> + my $parser = DateTime::Format::Strptime->new( pattern => >>> $self->date_format ); >>> + $self->parser($parser); >>> + >>> my $dbh = eval { >>> DBI->connect( $self->dsn, $self->user, $self->password ) >>> || die "Cannot connect to database: $DBI::errstr"; >>> @@ -183,7 +188,7 @@ >>> my @fields = @WF_FIELDS[1,2,3]; >>> my @values = ( $wf->type, >>> $wf->state, >>> - DateTime->now->strftime( '%Y-%m-%d %H:%M' ) ); >>> + DateTime->now->strftime( $self->date_format >>> () ) ); >>> my $dbh = $self->handle; >>> >>> my $id = $self->workflow_id_generator->pre_fetch_id( $dbh ); >>> @@ -249,7 +254,7 @@ >>> my $row = $sth->fetchrow_arrayref; >>> return undef unless ( $row ); >>> return { state => $row->[0], >>> - last_update => $parser->parse_datetime( $row-> >>> [1] ), }; >>> + last_update => $self->parser->parse_datetime( $row-> >>> [1] ), }; >>> } >>> >>> sub update_workflow { >>> @@ -263,7 +268,7 @@ >>> WHERE $WF_FIELDS[0] = ? >>> }; >>> $sql = sprintf( $sql, $self->workflow_table ); >>> - my $update_date = DateTime->now->strftime( '%Y-%m-%d %H:%M' ); >>> + my $update_date = DateTime->now->strftime( $self->date_format >>> () ); >>> >>> if ( $log->is_debug ) { >>> $log->debug( "Will use SQL\n$sql" ); >>> @@ -293,7 +298,7 @@ >>> my $id = $generator->pre_fetch_id( $dbh ); >>> my @fields = @HIST_FIELDS[1..6]; >>> my @values = ( $wf->id, $h->action, $h->description, $h- >>> >state, >>> - $h->user, $h->date->strftime( '%Y-%m-%d % >>> H:%M' ) ); >>> + $h->user, $h->date->strftime( >>> $self->date_format() ) ); >>> if ( $id ) { >>> push @fields, $HIST_FIELDS[0]; >>> push @values, $id; >>> @@ -368,7 +373,7 @@ >>> description => $row->[3], >>> state => $row->[4], >>> user => $row->[5], >>> - date => $parser->parse_datetime( $row->[6] ), >>> + date => $self->parser->parse_datetime( $row-> >>> [6] ), >>> }); >>> $log->is_debug && >>> $log->debug( "Fetched history object '$row->[0]'" ); >>> @@ -530,6 +535,15 @@ >>> >>> Password for C<user> to login with. >>> >>> +=item B<date_format> >>> + >>> +Date format to use when working with the database. Accepts a >>> format string >>> +that can be processed by the DateTime module. See >>> +L<http://search.cpan.org/~drolsky/DateTime-0.39/lib/ >>> DateTime.pm#strftime_Specifiers> >>> +for the format options. >>> + >>> +The default is '%Y-%m-%d %H:%M' for backward compatibility. >>> + >>> =item B<workflow_table> >>> >>> Table to use for persisting workflow. Default is 'workflow'. >>> @@ -699,4 +713,4 @@ >>> >>> Chris Winters E<lt>ch...@cw...E<gt>, original author. >>> >>> -=cut >>> \ No newline at end of file >>> +=cut >>> diff -urX workflow.exclude orig/Workflow-0.28/t/TestUtil.pm >>> working/Workflow-0.28/t/TestUtil.pm >>> --- orig/Workflow-0.28/t/TestUtil.pm 2007-07-06 >>> 10:43:11.000000000 -0400 >>> +++ working/Workflow-0.28/t/TestUtil.pm 2007-08-10 >>> 11:31:31.000000000 -0400 >>> @@ -95,6 +95,7 @@ >>> name => 'TestPersister', >>> class => 'Workflow::Persister::DBI', >>> dsn => 'DBI:Mock:', >>> + user => 'DBTester', >>> ); >>> $factory->add_config( persister => [ \%persister ] ); >>> } >>> diff -urX workflow.exclude orig/Workflow-0.28/t/persister_dbi.t >>> working/Workflow-0.28/t/persister_dbi.t >>> --- orig/Workflow-0.28/t/persister_dbi.t 2007-07-06 >>> 10:43:11.000000000 -0400 >>> +++ working/Workflow-0.28/t/persister_dbi.t 2007-08-10 >>> 11:27:49.000000000 -0400 >>> @@ -5,7 +5,7 @@ >>> use strict; >>> use lib 't'; >>> use TestUtil; >>> -use constant NUM_TESTS => 41; >>> +use constant NUM_TESTS => 43; >>> use Test::More; >>> >>> eval "require DBI"; >>> @@ -18,7 +18,6 @@ >>> >>> my $TICKET_CLASS = 'TestApp::Ticket'; >>> my $DATE_FORMAT = '%Y-%m-%d %H:%M'; >>> -my $NOW = DateTime->now->strftime( $DATE_FORMAT ); >>> >>> require_ok( 'Workflow::Persister::DBI' ); >>> >>> @@ -26,6 +25,8 @@ >>> name => 'TestPersister', >>> class => 'Workflow::Persister::DBI', >>> dsn => 'DBI:Mock:', >>> + user => 'DBTester', >>> + date_format => $DATE_FORMAT, >>> }); >>> >>> my $factory = Workflow::Factory->instance; >>> @@ -37,6 +38,9 @@ >>> my $persister = $factory->get_persister( 'TestPersister' ); >>> my $handle = $persister->handle; >>> >>> +is ($persister->dsn(), 'DBI:Mock:', 'Got back dsn from config.'); >>> +is ($persister->date_format(), '%Y-%m-%d %H:%M', 'Got back date >>> format >>> from config.'); >>> + >>> my ( $wf ); >>> >>> { >>> @@ -52,7 +56,7 @@ >>> qr/^INSERT INTO workflow \( type, state, last_update, >>> workflow_id \)/, >>> [ 'type', 'state', 'current date', >>> 'random ID of correct length' ], >>> - [ 'Ticket', 'INITIAL', $NOW, >>> + [ 'Ticket', 'INITIAL', DateTime->now->strftime >>> ( $DATE_FORMAT ), >>> sub { my ( $val ) = @_; return ( length( $val ), 8 ) } ] >>> ); >>> >>> @@ -60,7 +64,7 @@ >>> TestUtil->check_workflow_history( >>> $hst_history, >>> [ $wf_id, 'Create workflow', 'Create new workflow', >>> - 'INITIAL', 'n/a', $NOW, >>> + 'INITIAL', 'n/a', DateTime->now->strftime >>> ( $DATE_FORMAT ), >>> sub { my ( $val ) = @_; return ( length( $val ), 8 ) } ] >>> ); >>> $handle->{mock_clear_history} = 1; >>> @@ -91,7 +95,7 @@ >>> 'due date', 'last update' ], >>> [ $ticket_id, $ticket_info{type}, $ticket_info{subject}, >>> $ticket_info{description}, $ticket_info{creator}, >>> $old_state, >>> - $ticket_info{due_date}->strftime( '%Y-%m-%d' ), $NOW ] >>> + $ticket_info{due_date}->strftime( '%Y-%m-%d' ), >>> DateTime->now->strftime( $DATE_FORMAT ) ] >>> ); >>> >>> my $link_create = $history->[1]; >>> @@ -102,7 +106,7 @@ >>> TestUtil->check_workflow_history( >>> $hst_update, >>> [ $wf_id, 'Create ticket', $history_desc, >>> - 'TIX_CREATED', $ticket_info{creator}, $NOW, >>> + 'TIX_CREATED', $ticket_info{creator}, >>> DateTime->now->strftime( $DATE_FORMAT ), >>> sub { my ( $val ) = @_; return ( length( $val ), 8 ) } ] >>> ); >>> >>> >>> >>> -- >>> Jim Brandt >>> Administrative Computing Services >>> University at Buffalo >>> >>> >>> >>> -------------------------------------------------------------------- >>> ----- >>> This SF.net email is sponsored by: Splunk Inc. >>> Still grepping through log files to find problems? Stop. >>> Now Search log events and configuration files using AJAX and a >>> browser. >>> Download your FREE copy of Splunk now >> http://get.splunk.com/ >>> _______________________________________________ >>> Perl-workflow-devel mailing list >>> Per...@li... >>> https://lists.sourceforge.net/lists/listinfo/perl-workflow-devel > > -- > Jim Brandt > Administrative Computing Services > University at Buffalo > > diff -urX workflow.exclude orig/Workflow-0.28/lib/Workflow/Action/ > InputField.pm working/Workflow-0.28/lib/Workflow/Action/InputField.pm > --- orig/Workflow-0.28/lib/Workflow/Action/InputField.pm 2007-07-06 > 10:43:11.000000000 -0400 > +++ working/Workflow-0.28/lib/Workflow/Action/InputField.pm > 2007-08-10 11:35:40.000000000 -0400 > @@ -17,7 +17,8 @@ > sub new { > my ( $class, $params ) = @_; > my $log = get_logger(); > - $log->debug( "Instantiating new field '$params->{name}'" ); > + $log->debug( "Instantiating new field '$params->{name}'" ) > + if $params->{name}; > > my $self = bless( {}, $class ); > > diff -urX workflow.exclude orig/Workflow-0.28/lib/Workflow/ > Persister/DBI.pm working/Workflow-0.28/lib/Workflow/Persister/DBI.pm > --- orig/Workflow-0.28/lib/Workflow/Persister/DBI.pm 2007-07-06 > 10:43:11.000000000 -0400 > +++ working/Workflow-0.28/lib/Workflow/Persister/DBI.pm 2007-08-10 > 12:49:31.000000000 -0400 > @@ -17,11 +17,10 @@ > $Workflow::Persister::DBI::VERSION = '1.19'; > > my @FIELDS = qw( handle dsn user password driver > - workflow_table history_table ); > + workflow_table history_table date_format parser); > __PACKAGE__->mk_accessors( @FIELDS ); > > my ( $log ); > -my $parser = DateTime::Format::Strptime->new( pattern => '%Y-%m-%d > %H:%M' ); > my @WF_FIELDS = (); > my @HIST_FIELDS = (); > > @@ -48,10 +47,16 @@ > $log->info( "Assigned workflow table '", $self- > >workflow_table, "'; ", > "history table '", $self->history_table, "'" ); > > - for ( qw( dsn user password ) ) { > + # Default to old date format if not provided so we don't break > old configurations. > + $self->date_format( '%Y-%m-%d %H:%M' ); > + > + for ( qw( dsn user password date_format ) ) { > $self->$_( $params->{ $_ } ) if ( $params->{ $_ } ); > } > > + my $parser = DateTime::Format::Strptime->new( pattern => $self- > >date_format ); > + $self->parser($parser); > + > my $dbh = eval { > DBI->connect( $self->dsn, $self->user, $self->password ) > || die "Cannot connect to database: $DBI::errstr"; > @@ -183,7 +188,7 @@ > my @fields = @WF_FIELDS[1,2,3]; > my @values = ( $wf->type, > $wf->state, > - DateTime->now->strftime( '%Y-%m-%d %H:%M' ) ); > + DateTime->now->strftime( $self->date_format() ) ); > my $dbh = $self->handle; > > my $id = $self->workflow_id_generator->pre_fetch_id( $dbh ); > @@ -249,7 +254,7 @@ > my $row = $sth->fetchrow_arrayref; > return undef unless ( $row ); > return { state => $row->[0], > - last_update => $parser->parse_datetime( $row->[1] ), }; > + last_update => $self->parser->parse_datetime( $row-> > [1] ), }; > } > > sub update_workflow { > @@ -263,7 +268,7 @@ > WHERE $WF_FIELDS[0] = ? > }; > $sql = sprintf( $sql, $self->workflow_table ); > - my $update_date = DateTime->now->strftime( '%Y-%m-%d %H:%M' ); > + my $update_date = DateTime->now->strftime( $self->date_format > () ); > > if ( $log->is_debug ) { > $log->debug( "Will use SQL\n$sql" ); > @@ -293,7 +298,7 @@ > my $id = $generator->pre_fetch_id( $dbh ); > my @fields = @HIST_FIELDS[1..6]; > my @values = ( $wf->id, $h->action, $h->description, $h- > >state, > - $h->user, $h->date->strftime( '%Y-%m-%d %H:% > M' ) ); > + $h->user, $h->date->strftime( $self- > >date_format() ) ); > if ( $id ) { > push @fields, $HIST_FIELDS[0]; > push @values, $id; > @@ -368,7 +373,7 @@ > description => $row->[3], > state => $row->[4], > user => $row->[5], > - date => $parser->parse_datetime( $row->[6] ), > + date => $self->parser->parse_datetime( $row-> > [6] ), > }); > $log->is_debug && > $log->debug( "Fetched history object '$row->[0]'" ); > @@ -530,6 +535,15 @@ > > Password for C<user> to login with. > > +=item B<date_format> > + > +Date format to use when working with the database. Accepts a > format string > +that can be processed by the DateTime module. See > +L<http://search.cpan.org/~drolsky/DateTime-0.39/lib/ > DateTime.pm#strftime_Specifiers> > +for the format options. > + > +The default is '%Y-%m-%d %H:%M' for backward compatibility. > + > =item B<workflow_table> > > Table to use for persisting workflow. Default is 'workflow'. > @@ -699,4 +713,4 @@ > > Chris Winters E<lt>ch...@cw...E<gt>, original author. > > -=cut > \ No newline at end of file > +=cut > diff -urX workflow.exclude orig/Workflow-0.28/t/TestUtil.pm working/ > Workflow-0.28/t/TestUtil.pm > --- orig/Workflow-0.28/t/TestUtil.pm 2007-07-06 10:43:11.000000000 > -0400 > +++ working/Workflow-0.28/t/TestUtil.pm 2007-08-10 > 11:31:31.000000000 -0400 > @@ -95,6 +95,7 @@ > name => 'TestPersister', > class => 'Workflow::Persister::DBI', > dsn => 'DBI:Mock:', > + user => 'DBTester', > ); > $factory->add_config( persister => [ \%persister ] ); > } > diff -urX workflow.exclude orig/Workflow-0.28/t/persister_dbi.t > working/Workflow-0.28/t/persister_dbi.t > --- orig/Workflow-0.28/t/persister_dbi.t 2007-07-06 > 10:43:11.000000000 -0400 > +++ working/Workflow-0.28/t/persister_dbi.t 2007-08-10 > 11:27:49.000000000 -0400 > @@ -5,7 +5,7 @@ > use strict; > use lib 't'; > use TestUtil; > -use constant NUM_TESTS => 41; > +use constant NUM_TESTS => 43; > use Test::More; > > eval "require DBI"; > @@ -18,7 +18,6 @@ > > my $TICKET_CLASS = 'TestApp::Ticket'; > my $DATE_FORMAT = '%Y-%m-%d %H:%M'; > -my $NOW = DateTime->now->strftime( $DATE_FORMAT ); > > require_ok( 'Workflow::Persister::DBI' ); > > @@ -26,6 +25,8 @@ > name => 'TestPersister', > class => 'Workflow::Persister::DBI', > dsn => 'DBI:Mock:', > + user => 'DBTester', > + date_format => $DATE_FORMAT, > }); > > my $factory = Workflow::Factory->instance; > @@ -37,6 +38,9 @@ > my $persister = $factory->get_persister( 'TestPersister' ); > my $handle = $persister->handle; > > +is ($persister->dsn(), 'DBI:Mock:', 'Got back dsn from config.'); > +is ($persister->date_format(), '%Y-%m-%d %H:%M', 'Got back date > format from config.'); > + > my ( $wf ); > > { > @@ -52,7 +56,7 @@ > qr/^INSERT INTO workflow \( type, state, last_update, > workflow_id \)/, > [ 'type', 'state', 'current date', > 'random ID of correct length' ], > - [ 'Ticket', 'INITIAL', $NOW, > + [ 'Ticket', 'INITIAL', DateTime->now->strftime > ( $DATE_FORMAT ), > sub { my ( $val ) = @_; return ( length( $val ), 8 ) } ] > ); > > @@ -60,7 +64,7 @@ > TestUtil->check_workflow_history( > $hst_history, > [ $wf_id, 'Create workflow', 'Create new workflow', > - 'INITIAL', 'n/a', $NOW, > + 'INITIAL', 'n/a', DateTime->now->strftime( $DATE_FORMAT ), > sub { my ( $val ) = @_; return ( length( $val ), 8 ) } ] > ); > $handle->{mock_clear_history} = 1; > @@ -91,7 +95,7 @@ > 'due date', 'last update' ], > [ $ticket_id, $ticket_info{type}, $ticket_info{subject}, > $ticket_info{description}, $ticket_info{creator}, > $old_state, > - $ticket_info{due_date}->strftime( '%Y-%m-%d' ), $NOW ] > + $ticket_info{due_date}->strftime( '%Y-%m-%d' ), DateTime- > >now->strftime( $DATE_FORMAT ) ] > ); > > my $link_create = $history->[1]; > @@ -102,7 +106,7 @@ > TestUtil->check_workflow_history( > $hst_update, > [ $wf_id, 'Create ticket', $history_desc, > - 'TIX_CREATED', $ticket_info{creator}, $NOW, > + 'TIX_CREATED', $ticket_info{creator}, DateTime->now- > >strftime( $DATE_FORMAT ), > sub { my ( $val ) = @_; return ( length( $val ), 8 ) } ] > ); > |
From: Jim B. <cb...@bu...> - 2007-08-13 14:42:19
|
Sorry about that. Maybe it's the linebreaks or some platform issue? The patch is attached. On my Mac, I was able to get this to work: 10:35am brandt1{~/test}->chmod -R 775 Workflow-0.28 10:35am brandt1{~/test}->cd Workflow-0.28 10:35am brandt1{~/test/Workflow-0.28}->cp ../workflow_patch . 10:35am brandt1{~/test/Workflow-0.28}->patch -p2 <workflow_patch patching file lib/Workflow/Action/InputField.pm patching file lib/Workflow/Persister/DBI.pm patching file t/TestUtil.pm patching file t/persister_dbi.t If it still bombs, I can try to regenerate it on a different box. Jim jonasbn wrote: > Hi Jim, > > Thanks very much for the patch. > > I made a branch in an attempt to apply it, so after some attempts I got > around to actual patching (I should not work when I am tired), anyway I > am experiencing some problems with your patch, which I attempt to apply > the following way: > > hyperstation ~/Desktop/Workflow-0.28 > % patch -p2 <dateformat.patch > patching file lib/Workflow/Action/InputField.pm > Hunk #1 FAILED at 17. > 1 out of 1 hunk FAILED -- saving rejects to file > lib/Workflow/Action/InputField.pm.rej > patching file lib/Workflow/Persister/DBI.pm > Hunk #1 FAILED at 17. > Hunk #2 FAILED at 47. > Hunk #3 FAILED at 188. > Hunk #4 FAILED at 254. > Hunk #5 FAILED at 268. > Hunk #6 FAILED at 298. > Hunk #7 FAILED at 373. > Hunk #8 FAILED at 535. > Hunk #9 succeeded at 713 with fuzz 2. > 8 out of 9 hunks FAILED -- saving rejects to file > lib/Workflow/Persister/DBI.pm.rej > patching file t/TestUtil.pm > Hunk #1 FAILED at 95. > 1 out of 1 hunk FAILED -- saving rejects to file t/TestUtil.pm.rej > patching file t/persister_dbi.t > Hunk #1 FAILED at 5. > Hunk #2 FAILED at 18. > Hunk #3 FAILED at 25. > Hunk #4 FAILED at 38. > Hunk #5 FAILED at 56. > Hunk #6 FAILED at 64. > Hunk #7 FAILED at 95. > Hunk #8 FAILED at 106. > 8 out of 8 hunks FAILED -- saving rejects to file t/persister_dbi.t.rej > hyperstation ~/Desktop/Workflow-0.28 > > I went away from the branch and attempted to work on a unpacked release > tar-ball instead, but I get the same errors. > > I had to correct a few lines in your patch since some of the lines were > broken into two lines. > > -my $parser = DateTime::Format::Strptime->new( pattern => '%Y-%m-%d > %H:%M' ); > > Should be one line I believe. If you can send me the same patch as an > attachment it would be appreciated. > > Any other suggestions or advice? > > jonasbn > -- > AIM: BjonasN Gtalk: jo...@gm... > ICQ: 62401545 MSN: jo...@io... > > > On 10/08/2007, at 19.13, Jim Brandt wrote: > >> Hello, >> >> Pasted below is a patch that allows you to pass in a date format for >> Persister::DBI. A few notes: >> >> * It perpetuates the issue I brought up with subclassing I mentioned >> before since you need to set up date_format and parser in your own init >> if you subclass Persister::DBI and don't call SUPER::init. >> >> * I think a took care of a few warnings from the TODO: >> >> - Eliminate warnings from DBD::Mock >> >> should be fixed >> >> - Investigate failings tests in t/persister_dbi.t, >> >> Yes, this was related to dates. $NOW was set at the top of the file and >> then used throughout, so the time could be off by the end of the file. >> This was easy to see in the debugger if you stopped the program for a >> while and then continued. >> >> I improved it by putting the actual code in each call when the date is >> needed, but I think this issue can still come up if the second flips >> while running. It should be less likely now. >> >> I didn't update any versions. Let me know if you can use the diff for >> some reason. >> >> Thanks, >> Jim >> >> >> >> diff -urX workflow.exclude >> orig/Workflow-0.28/lib/Workflow/Action/InputField.pm >> working/Workflow-0.28/lib/Workflow/Action/InputField.pm >> --- orig/Workflow-0.28/lib/Workflow/Action/InputField.pm 2007-07-06 >> 10:43:11.000000000 -0400 >> +++ working/Workflow-0.28/lib/Workflow/Action/InputField.pm 2007-08-10 >> 11:35:40.000000000 -0400 >> @@ -17,7 +17,8 @@ >> sub new { >> my ( $class, $params ) = @_; >> my $log = get_logger(); >> - $log->debug( "Instantiating new field '$params->{name}'" ); >> + $log->debug( "Instantiating new field '$params->{name}'" ) >> + if $params->{name}; >> >> my $self = bless( {}, $class ); >> >> diff -urX workflow.exclude >> orig/Workflow-0.28/lib/Workflow/Persister/DBI.pm >> working/Workflow-0.28/lib/Workflow/Persister/DBI.pm >> --- orig/Workflow-0.28/lib/Workflow/Persister/DBI.pm 2007-07-06 >> 10:43:11.000000000 -0400 >> +++ working/Workflow-0.28/lib/Workflow/Persister/DBI.pm 2007-08-10 >> 12:49:31.000000000 -0400 >> @@ -17,11 +17,10 @@ >> $Workflow::Persister::DBI::VERSION = '1.19'; >> >> my @FIELDS = qw( handle dsn user password driver >> - workflow_table history_table ); >> + workflow_table history_table date_format parser); >> __PACKAGE__->mk_accessors( @FIELDS ); >> >> my ( $log ); >> -my $parser = DateTime::Format::Strptime->new( pattern => '%Y-%m-%d >> %H:%M' ); >> my @WF_FIELDS = (); >> my @HIST_FIELDS = (); >> >> @@ -48,10 +47,16 @@ >> $log->info( "Assigned workflow table '", $self->workflow_table, >> "'; ", >> "history table '", $self->history_table, "'" ); >> >> - for ( qw( dsn user password ) ) { >> + # Default to old date format if not provided so we don't break old >> configurations. >> + $self->date_format( '%Y-%m-%d %H:%M' ); >> + >> + for ( qw( dsn user password date_format ) ) { >> $self->$_( $params->{ $_ } ) if ( $params->{ $_ } ); >> } >> >> + my $parser = DateTime::Format::Strptime->new( pattern => >> $self->date_format ); >> + $self->parser($parser); >> + >> my $dbh = eval { >> DBI->connect( $self->dsn, $self->user, $self->password ) >> || die "Cannot connect to database: $DBI::errstr"; >> @@ -183,7 +188,7 @@ >> my @fields = @WF_FIELDS[1,2,3]; >> my @values = ( $wf->type, >> $wf->state, >> - DateTime->now->strftime( '%Y-%m-%d %H:%M' ) ); >> + DateTime->now->strftime( $self->date_format() ) ); >> my $dbh = $self->handle; >> >> my $id = $self->workflow_id_generator->pre_fetch_id( $dbh ); >> @@ -249,7 +254,7 @@ >> my $row = $sth->fetchrow_arrayref; >> return undef unless ( $row ); >> return { state => $row->[0], >> - last_update => $parser->parse_datetime( $row->[1] ), }; >> + last_update => $self->parser->parse_datetime( $row->[1] >> ), }; >> } >> >> sub update_workflow { >> @@ -263,7 +268,7 @@ >> WHERE $WF_FIELDS[0] = ? >> }; >> $sql = sprintf( $sql, $self->workflow_table ); >> - my $update_date = DateTime->now->strftime( '%Y-%m-%d %H:%M' ); >> + my $update_date = DateTime->now->strftime( $self->date_format() ); >> >> if ( $log->is_debug ) { >> $log->debug( "Will use SQL\n$sql" ); >> @@ -293,7 +298,7 @@ >> my $id = $generator->pre_fetch_id( $dbh ); >> my @fields = @HIST_FIELDS[1..6]; >> my @values = ( $wf->id, $h->action, $h->description, $h->state, >> - $h->user, $h->date->strftime( '%Y-%m-%d %H:%M' >> ) ); >> + $h->user, $h->date->strftime( >> $self->date_format() ) ); >> if ( $id ) { >> push @fields, $HIST_FIELDS[0]; >> push @values, $id; >> @@ -368,7 +373,7 @@ >> description => $row->[3], >> state => $row->[4], >> user => $row->[5], >> - date => $parser->parse_datetime( $row->[6] ), >> + date => $self->parser->parse_datetime( $row->[6] ), >> }); >> $log->is_debug && >> $log->debug( "Fetched history object '$row->[0]'" ); >> @@ -530,6 +535,15 @@ >> >> Password for C<user> to login with. >> >> +=item B<date_format> >> + >> +Date format to use when working with the database. Accepts a format >> string >> +that can be processed by the DateTime module. See >> +L<http://search.cpan.org/~drolsky/DateTime-0.39/lib/DateTime.pm#strftime_Specifiers> >> >> +for the format options. >> + >> +The default is '%Y-%m-%d %H:%M' for backward compatibility. >> + >> =item B<workflow_table> >> >> Table to use for persisting workflow. Default is 'workflow'. >> @@ -699,4 +713,4 @@ >> >> Chris Winters E<lt>ch...@cw...E<gt>, original author. >> >> -=cut >> \ No newline at end of file >> +=cut >> diff -urX workflow.exclude orig/Workflow-0.28/t/TestUtil.pm >> working/Workflow-0.28/t/TestUtil.pm >> --- orig/Workflow-0.28/t/TestUtil.pm 2007-07-06 10:43:11.000000000 >> -0400 >> +++ working/Workflow-0.28/t/TestUtil.pm 2007-08-10 >> 11:31:31.000000000 -0400 >> @@ -95,6 +95,7 @@ >> name => 'TestPersister', >> class => 'Workflow::Persister::DBI', >> dsn => 'DBI:Mock:', >> + user => 'DBTester', >> ); >> $factory->add_config( persister => [ \%persister ] ); >> } >> diff -urX workflow.exclude orig/Workflow-0.28/t/persister_dbi.t >> working/Workflow-0.28/t/persister_dbi.t >> --- orig/Workflow-0.28/t/persister_dbi.t 2007-07-06 >> 10:43:11.000000000 -0400 >> +++ working/Workflow-0.28/t/persister_dbi.t 2007-08-10 >> 11:27:49.000000000 -0400 >> @@ -5,7 +5,7 @@ >> use strict; >> use lib 't'; >> use TestUtil; >> -use constant NUM_TESTS => 41; >> +use constant NUM_TESTS => 43; >> use Test::More; >> >> eval "require DBI"; >> @@ -18,7 +18,6 @@ >> >> my $TICKET_CLASS = 'TestApp::Ticket'; >> my $DATE_FORMAT = '%Y-%m-%d %H:%M'; >> -my $NOW = DateTime->now->strftime( $DATE_FORMAT ); >> >> require_ok( 'Workflow::Persister::DBI' ); >> >> @@ -26,6 +25,8 @@ >> name => 'TestPersister', >> class => 'Workflow::Persister::DBI', >> dsn => 'DBI:Mock:', >> + user => 'DBTester', >> + date_format => $DATE_FORMAT, >> }); >> >> my $factory = Workflow::Factory->instance; >> @@ -37,6 +38,9 @@ >> my $persister = $factory->get_persister( 'TestPersister' ); >> my $handle = $persister->handle; >> >> +is ($persister->dsn(), 'DBI:Mock:', 'Got back dsn from config.'); >> +is ($persister->date_format(), '%Y-%m-%d %H:%M', 'Got back date format >> from config.'); >> + >> my ( $wf ); >> >> { >> @@ -52,7 +56,7 @@ >> qr/^INSERT INTO workflow \( type, state, last_update, >> workflow_id \)/, >> [ 'type', 'state', 'current date', >> 'random ID of correct length' ], >> - [ 'Ticket', 'INITIAL', $NOW, >> + [ 'Ticket', 'INITIAL', DateTime->now->strftime( $DATE_FORMAT ), >> sub { my ( $val ) = @_; return ( length( $val ), 8 ) } ] >> ); >> >> @@ -60,7 +64,7 @@ >> TestUtil->check_workflow_history( >> $hst_history, >> [ $wf_id, 'Create workflow', 'Create new workflow', >> - 'INITIAL', 'n/a', $NOW, >> + 'INITIAL', 'n/a', DateTime->now->strftime( $DATE_FORMAT ), >> sub { my ( $val ) = @_; return ( length( $val ), 8 ) } ] >> ); >> $handle->{mock_clear_history} = 1; >> @@ -91,7 +95,7 @@ >> 'due date', 'last update' ], >> [ $ticket_id, $ticket_info{type}, $ticket_info{subject}, >> $ticket_info{description}, $ticket_info{creator}, $old_state, >> - $ticket_info{due_date}->strftime( '%Y-%m-%d' ), $NOW ] >> + $ticket_info{due_date}->strftime( '%Y-%m-%d' ), >> DateTime->now->strftime( $DATE_FORMAT ) ] >> ); >> >> my $link_create = $history->[1]; >> @@ -102,7 +106,7 @@ >> TestUtil->check_workflow_history( >> $hst_update, >> [ $wf_id, 'Create ticket', $history_desc, >> - 'TIX_CREATED', $ticket_info{creator}, $NOW, >> + 'TIX_CREATED', $ticket_info{creator}, >> DateTime->now->strftime( $DATE_FORMAT ), >> sub { my ( $val ) = @_; return ( length( $val ), 8 ) } ] >> ); >> >> >> >> -- >> Jim Brandt >> Administrative Computing Services >> University at Buffalo >> >> >> >> ------------------------------------------------------------------------- >> This SF.net email is sponsored by: Splunk Inc. >> Still grepping through log files to find problems? Stop. >> Now Search log events and configuration files using AJAX and a browser. >> Download your FREE copy of Splunk now >> http://get.splunk.com/ >> _______________________________________________ >> Perl-workflow-devel mailing list >> Per...@li... >> https://lists.sourceforge.net/lists/listinfo/perl-workflow-devel > -- Jim Brandt Administrative Computing Services University at Buffalo |