lib/openwfe/engine/status_methods.rb
#
# Returns a hash of ProcessStatus instances. The keys of the hash
# are workflow instance ids.
#
# A ProcessStatus is a description of the state of a process instance.
# It enumerates the expressions where the process is currently
# located (waiting certainly) and the errors the process currently
# has (hopefully none).
#
# the :wfid_prefix option is useful when you want to list all the process
# for a year (:wfid_prefix => '2007'), a month (:wfid_prefix => '200705') or
# a day (:wfid_prefix => '20070529').
#
Returns a hash of ProcessStatus instances. The keys of the hash
are workflow instance ids.

A ProcessStatus is a description of the state of a process instance.
It enumerates the expressions where the process is currently
located (waiting certainly) and the errors the process currently
has (hopefully none).


Returns a hash of ProcessStatus instances . The keys of the hash are workflow instance ids . A ProcessStatus is a description of the state of a process instance . It enumerates the expressions where the process is currently located ( waiting certainly ) and the errors the process currently has ( hopefully none ) .
def process_statuses (options={})
      all = (options == {})
      return @all_status_cache if all and @all_status_cache
      init_status_cache unless @status_cache
      options = { :wfid_prefix => options } if options.is_a?(String)
      expressions = get_expression_storage.find_expressions(options)
      result = expressions.inject({}) do |r, fe|
        (r[fe.fei.parent_wfid] ||= ProcessStatus.new) << fe; r
      end
      result.values.each do |ps|
        ps.paused = (get_expool.paused_instances[ps.wfid] != nil)
        get_error_journal.get_error_log(ps.wfid).each { |er| ps << er }
        ps.send(:pack_expressions) 
        ps.scheduled_jobs = get_scheduler.find_jobs(ps.wfid)
      end
      result.delete('0')
      @status_cache.delete('0')
       done
      result.extend(StatusesMixin)
      result.timestamp = Time.now
      @all_status_cache = result if all
      result
    end
def process_statuses ( options = { } ) all = ( options == { } ) return @all_status_cache if all and @all_status_cache init_status_cache unless @status_cache options = { :wfid_prefix => options } if options . is_a? ( String ) expressions = get_expression_storage . find_expressions ( options ) result = expressions . inject ( { } ) do | r , fe | ( r [ fe . fei . parent_wfid ] ||= ProcessStatus . new ) << fe ; r end result . values . each do | ps | ps . paused = ( get_expool . paused_instances [ ps . wfid ] != nil ) get_error_journal . get_error_log ( ps . wfid ) . each { | er | ps << er } ps . send ( :pack_expressions ) ps . scheduled_jobs = get_scheduler . find_jobs ( ps . wfid ) end result . delete ( '0' ) @status_cache . delete ( '0' ) result . extend ( StatusesMixin ) result . timestamp = Time . now @all_status_cache = result if all result end
Returns a hash of ProcessStatus instances.
Returns a hash of ProcessStatus instances .
# letting it protected # # done
options
<not_specific>