Hi John, et al.,

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?

Thanks,
Ian

-- 
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