lib/openwfe/expool/errorjournal.rb in openwferu-0.9.16 vs lib/openwfe/expool/errorjournal.rb in openwferu-0.9.17

- old
+ new

@@ -1,8 +1,8 @@ # #-- -# Copyright (c) 2007, John Mettraux, OpenWFE.org +# Copyright (c) 2007-2008, John Mettraux, OpenWFE.org # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # @@ -198,11 +198,11 @@ # ejournal.replay_at_last_error('20070630-hiwakuzara', 1) # # Will replay a given process instance at its 1 to last error. # #def replay_at_last_error (wfid, offset=0) - # wfid = to_wfid(wfid) + # wfid = extract_wfid(wfid) # log = get_error_log(wfid) # index = (-1 - offset) # error = log[index] # raise "no error for process '#{wfid}' at offset #{offset}" \ # unless error @@ -270,20 +270,20 @@ # Will return an empty list if there a no errors for the process # instances. # def get_error_log (wfid) - wfid = to_wfid(wfid) + wfid = extract_wfid wfid, true @per_processes[wfid] or [] end # # Removes the error log for a process instance. # def remove_error_log (wfid) - wfid = to_wfid(wfid) + wfid = extract_wfid wfid, true @per_processes.delete(wfid) end # # Removes a list of errors from the error journal. @@ -347,11 +347,11 @@ # Will return an empty list if there a no errors for the process # instances. # def get_error_log (wfid) - path = get_path(wfid) + path = get_path wfid return [] unless File.exist?(path) read_error_log_from path end @@ -468,9 +468,9 @@ # Returns the path to the error log file of a specific process # instance. # def get_path (fei_or_wfid) - @workdir + "/" + to_wfid(fei_or_wfid) + ".ejournal" + @workdir + "/" + extract_wfid(fei_or_wfid, true) + ".ejournal" end end end