Class: Dor::WorkflowIndexer
- Inherits:
-
Object
- Object
- Dor::WorkflowIndexer
- Defined in:
- lib/dor/indexers/workflow_indexer.rb
Overview
Indexes the objects position in workflows
Instance Method Summary collapse
-
#initialize(document:) ⇒ WorkflowIndexer
constructor
A new instance of WorkflowIndexer.
-
#to_solr ⇒ Hash
The partial solr document for the workflow document.
Constructor Details
#initialize(document:) ⇒ WorkflowIndexer
Returns a new instance of WorkflowIndexer.
14 15 16 |
# File 'lib/dor/indexers/workflow_indexer.rb', line 14 def initialize(document:) @document = document end |
Instance Method Details
#to_solr ⇒ Hash
Returns the partial solr document for the workflow document.
19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/dor/indexers/workflow_indexer.rb', line 19 def to_solr WorkflowSolrDocument.new do |solr_doc| wf_name = document.workflowId.first solr_doc.name = wf_name errors = processes.count(&:error?) repo = document.repository.first solr_doc.status = [wf_name, workflow_status, errors, repo].join('|') processes.each do |process| index_process(solr_doc, wf_name, process) end end end |