On Mon, Aug 23, 2010 at 10:24:37AM -0700, I. E. Smith-Heisters wrote:
> 
> We'd like to be able to snapshot and restore processes. There's a
> double goal in this, in that it should aid in testing (serving as a
> fixture), and, more importantly, help us deal with process problems by
> backing them up, allowing us to edit them in a text-editor, and
> restoring them.
> 
> We're using CouchDB as the storage mechanism, so it seems like it
> should be pretty straightforward. We start by assuming that there are
> no external jobs working on the process (eg. background jobs or the
> Ruote worker). Then I simply GET the workitems, expressions, and
> history (yes, I'm ignoring errors), convert each to a hash, and
> persist it to disk as YAML. Restoring the process *seems* to be as
> simple as:
> 
>       hash = YAML.load_file("process.yml")
>       %w(workitems expressions history).each do |type|
>         hash[type].each do |doc|
>           doc.delete '_rev'
>           doc.merge! 'type' => type
>           Engine.context.storage.put doc
>         end
>       end
> 
> Is this a fundamentally bad idea? If not, is this a good way to do it?
> Is there a better way?

Hello Ian,

it's a very good idea. Your restoration process is correct.

I'd copy the 'schedules' as well (but then we'd have to care about offsetting 
the schedules when re-inserting).

I'm probably going to steal some of this idea. Though it might not play well 
with processes emitting towards external participants (in those cases people 
ask about how to replay processes up to a certain point).

If you encounter issues, I'd be glad to help.


Best regards,

-- 
John Mettraux - http://jmettraux.wordpress.com

-- 
you received this message because you are subscribed to the "ruote users" group.
to post : send email to [email protected]
to unsubscribe : send email to [email protected]
more options : http://groups.google.com/group/openwferu-users?hl=en

Reply via email to