lib/dor/workflow_archiver.rb
def find_completed_objects
      return to_enum(:find_completed_objects) unless block_given?

      completed_query = <<-EOSQL
       select distinct repository, datastream, druid
       from workflow w1
       where w1.status in ('completed', 'skipped')
       and not exists
       (
          select *
          from workflow w2
          where w1.repository = w2.repository
          and w1.datastream = w2.datastream
          and w1.druid = w2.druid
          and w2.status not in ('completed', 'skipped')
       )
      EOSQL

      conn.fetch(completed_query) do |row|
        yield row
      end
    end
# Finds objects where all workflow steps are complete
# @return [Array<Hash{String=>String}>] each hash returned has the following keys:
#   {"REPOSITORY"=>"dor", "DRUID"=>"druid:345", "DATASTREAM"=>"googleScannedBookWF"}
Finds objects where all workflow steps are complete
Finds objects where all workflow steps are complete
def find_completed_objects
      return to_enum(:find_completed_objects) unless block_given?
      completed_query = <<-EOSQL
       select distinct repository, datastream, druid
       from workflow w1
       where w1.status in ('completed', 'skipped')
       and not exists
       (
          select *
          from workflow w2
          where w1.repository = w2.repository
          and w1.datastream = w2.datastream
          and w1.druid = w2.druid
          and w2.status not in ('completed', 'skipped')
       )
      EOSQL
      conn.fetch(completed_query) do |row|
        yield row
      end
    end
def find_completed_objects return to_enum ( :find_completed_objects ) unless block_given? completed_query = <<-EOSQL 
       select distinct repository, datastream, druid
       from workflow w1
       where w1.status in ('completed', 'skipped')
       and not exists
       (
          select *
          from workflow w2
          where w1.repository = w2.repository
          and w1.datastream = w2.datastream
          and w1.druid = w2.druid
          and w2.status not in ('completed', 'skipped')
       )
       EOSQL conn . fetch ( completed_query ) do | row | yield row end end
Finds objects where all workflow steps are complete
Finds objects where all workflow steps are complete
each hash returned has the following keys: {"REPOSITORY"=>"dor", "DRUID"=>"druid:345", "DATASTREAM"=>"googleScannedBookWF"}
each hash returned has the following keys : { " REPOSITORY " = > " dor " " DRUID " = > " druid : 345 " " DATASTREAM " = > " googleScannedBookWF " }
Array<Hash{String=>String}>