Class: Hyrax::Workflow::WorkflowActionService
- Inherits:
-
Object
- Object
- Hyrax::Workflow::WorkflowActionService
- Defined in:
- app/services/hyrax/workflow/workflow_action_service.rb
Overview
Responsible for coordinating the behavior of an action taken within a workflow
Instance Attribute Summary collapse
-
#action ⇒ Object
readonly
Returns the value of attribute action.
-
#comment_text ⇒ Object
readonly
Returns the value of attribute comment_text.
-
#subject ⇒ Object
readonly
Returns the value of attribute subject.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(subject:, action:, comment:) ⇒ WorkflowActionService
constructor
A new instance of WorkflowActionService.
- #run ⇒ Object
Constructor Details
#initialize(subject:, action:, comment:) ⇒ WorkflowActionService
Returns a new instance of WorkflowActionService.
9 10 11 12 13 |
# File 'app/services/hyrax/workflow/workflow_action_service.rb', line 9 def initialize(subject:, action:, comment:) @subject = subject @action = action @comment_text = comment end |
Instance Attribute Details
#action ⇒ Object (readonly)
Returns the value of attribute action.
15 16 17 |
# File 'app/services/hyrax/workflow/workflow_action_service.rb', line 15 def action @action end |
#comment_text ⇒ Object (readonly)
Returns the value of attribute comment_text.
15 16 17 |
# File 'app/services/hyrax/workflow/workflow_action_service.rb', line 15 def comment_text @comment_text end |
#subject ⇒ Object (readonly)
Returns the value of attribute subject.
15 16 17 |
# File 'app/services/hyrax/workflow/workflow_action_service.rb', line 15 def subject @subject end |
Class Method Details
.run(subject:, action:, comment: nil) ⇒ Object
5 6 7 |
# File 'app/services/hyrax/workflow/workflow_action_service.rb', line 5 def self.run(subject:, action:, comment: nil) new(subject: subject, action: action, comment: comment).run end |
Instance Method Details
#run ⇒ Object
17 18 19 20 21 22 23 |
# File 'app/services/hyrax/workflow/workflow_action_service.rb', line 17 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 |