Class: CurationConcerns::Workflow::WorkflowActionService

Inherits:
Object
  • Object
show all
Defined in:
app/services/curation_concerns/workflow/workflow_action_service.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(subject:, action:, comment:) ⇒ WorkflowActionService

Returns a new instance of WorkflowActionService.



8
9
10
11
12
# File 'app/services/curation_concerns/workflow/workflow_action_service.rb', line 8

def initialize(subject:, action:, comment:)
  @subject = subject
  @action = action
  @comment_text = comment
end

Instance Attribute Details

#actionObject (readonly)

Returns the value of attribute action.



14
15
16
# File 'app/services/curation_concerns/workflow/workflow_action_service.rb', line 14

def action
  @action
end

#comment_textObject (readonly)

Returns the value of attribute comment_text.



14
15
16
# File 'app/services/curation_concerns/workflow/workflow_action_service.rb', line 14

def comment_text
  @comment_text
end

#subjectObject (readonly)

Returns the value of attribute subject.



14
15
16
# File 'app/services/curation_concerns/workflow/workflow_action_service.rb', line 14

def subject
  @subject
end

Class Method Details

.run(subject:, action:, comment: nil) ⇒ Object



4
5
6
# File 'app/services/curation_concerns/workflow/workflow_action_service.rb', line 4

def self.run(subject:, action:, comment: nil)
  new(subject: subject, action: action, comment: comment).run
end

Instance Method Details

#runObject



16
17
18
19
20
21
22
# File 'app/services/curation_concerns/workflow/workflow_action_service.rb', line 16

def run
  update_sipity_workflow_state
  comment = create_sipity_comment
  handle_sipity_notifications(comment: comment)
  handle_additional_sipity_workflow_action_processing(comment: comment)
  subject.work.update_index # So that the new actions and state are written into solr.
end