Re: [Perl-workflow-devel] Patch from Heiko (RT #64940)
Brought to you by:
jonasbn
From: Alejandro I. <ai...@p2...> - 2011-01-29 17:05:52
|
On Sat, Jan 29, 2011 at 11:39 AM, Jonas B. Nielsen <jo...@gm...> wrote: > Hello All, > > We have received a patch from Heiko Schlitterman > > Please see RT queue: https://rt.cpan.org/Ticket/Display.html?id=64940 > > The issue being fixed is longevity of workflow context. > > The documentation does not say anything and it seems the context is more a scratchpad. At the same time I think Heiko's take is pretty okay - but I do not want to break anything. > > Please let me know what you think, > It seems good but I agree with you: Context is a meant as a disposable stash akin to TT's stash, catalysts's stash, etc. if you need to save stuff from the context, that is _precisely_ what the ExtraData extension is for, so no need to add this to the core IMHO. I do understand their need however, because I do a similar thing in p2ee. We save some of the stuff from the context in our workflows as "state_data" is a JSON string using the standard extension mechanisms already provided by Workflow.pm namely Workflow::Persister::DBI::ExtraData, here is our persister config: <persisters> <persister name="Inventory" class="Workflow::Persister::DBI::ExtraData" dsn="DBI:Pg:dbname=p2ee" user="inventory" password="inventory" date_format="%Y-%m-%d %H:%M" autocommit="1" workflow_table="wf" workflow_sequence="wf_workflow_id_seq" history_table="wf_history" history_sequence="wf_history_workflow_hist_id_seq" extra_table="wf_p2ee" extra_data_field="creator,citho,citho_since" /> </persisters> So my vote is -1 on this incorporating this patch because this is already avail in the core capabilities via ExtraData. It would be interesting nevertheless to have an extension and standard mechanism to give context persistence (but people are probably storing all sorts of stuff like references into the context so I can't envision how to make a general case). But before investing in extensions to the current code I would rather invest efforts to port Workflow to Moose first. I do vote +1 however to port to Moose, though OT to this thread ;-) Best, Alex |