Module Ruote::StorageBase
In: lib/ruote/storage/base.rb

Base methods for storage implementations.

Methods

Protected Class methods

Used by ruote-couch and ruote-asw

Public Instance methods

Used when doing integration tests, removes all msgs, schedules, errors, expressions and workitems.

NOTE that it doesn‘t remove engine variables (danger)

Copies the content of this storage into a target storage.

Of course, the target storage may be a different implementation.

Given all the expressions stored here, returns a sorted list of unique wfids (this is used in Engine#processes(opts).

Understands the :skip, :limit and :descending options.

This is a base implementation, different storage implementations may come up with different implementations (think CouchDB, which could provide a view for it).

Given a wfid, returns all the expressions of that process instance.

For a given wfid, fetches all the root expressions, sort by expid and return the first. Hopefully it‘s the right root_expression.

For a given wfid, returns all the expressions (array of Hash instances) that have a nil ‘parent_id’.

Some storage implementation might need the wfid information when adding or removing trackers.

Places schedule in storage. Returns the id of the ‘schedule’ document. If the schedule got triggered immediately, nil is returned.

Removes a process by removing all its schedules, expressions, errors, workitems and trackers.

Warning: will not trigger any cancel behaviours at all, just removes the process.

Attempts to delete a document, returns true if the deletion succeeded. This is used with msgs to reserve work on them.

Warning, this is not equivalent to doing @context.worker, this method fetches the worker from the local thread variables.

Protected Instance methods

Returns all the ats whose due date arrived (now or earlier)

Used by get_many. Returns true whenever one of the keys matches the doc[‘_id’]. Works with strings (_id ends with key) or regexes (_id matches key).

[Validate]