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.

Methods

Public Class methods

[Source]

     # File lib/openwfe/expool/errorjournal.rb, line 259
259:         def initialize (service_name, application_context)
260: 
261:             super
262: 
263:             @per_processes = {}
264:         end

Public Instance methods

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.

[Source]

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

[Source]

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

[Source]

     # 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).

[Source]

     # 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

Protected Instance methods

[Source]

     # File lib/openwfe/expool/errorjournal.rb, line 315
315:             def record_error (error)
316: 
317:                 (@per_processes[error.wfid] ||= []) << error
318:                     # not that unreadable after all...
319:             end

[Validate]