| Class | OpenWFE::InMemoryErrorJournal |
| In: |
lib/openwfe/expool/errorjournal.rb
|
| Parent: | ErrorJournal |
Stores all the errors in a hash… For testing purposes only, like the InMemoryExpressionStorage.
# File lib/openwfe/expool/errorjournal.rb, line 259
259: def initialize (service_name, application_context)
260:
261: super
262:
263: @per_processes = {}
264: end
Returns a list (older first) of the errors for a process instance identified by its fei or wfid.
Will return an empty list if there a no errors for the process instances.
# File lib/openwfe/expool/errorjournal.rb, line 273
273: def get_error_log (wfid)
274:
275: wfid = extract_wfid wfid, true
276: @per_processes[wfid] or []
277: end
Reads all the error logs currently stored. Returns a hash wfid —> error list.
# File lib/openwfe/expool/errorjournal.rb, line 308
308: def get_error_logs
309:
310: @per_processes
311: end
Removes the error log for a process instance.
# File lib/openwfe/expool/errorjournal.rb, line 282
282: def remove_error_log (wfid)
283:
284: wfid = extract_wfid wfid, true
285: @per_processes.delete(wfid)
286: end
Removes a list of errors from the error journal.
The ‘errors’ parameter may be a single error (instead of an array).
# File lib/openwfe/expool/errorjournal.rb, line 293
293: def remove_errors (wfid, errors)
294:
295: errors = Array(errors)
296:
297: log = get_error_log wfid
298:
299: errors.each do |e|
300: log.delete e
301: end
302: end