class LyberCore::Workflow
This encapsulates the workflow operations that lyber-core does
Attributes
druid[R]
process[R]
workflow_name[R]
workflow_service[R]
Public Class Methods
new(workflow_service:, druid:, workflow_name:, process:)
click to toggle source
# File lib/lyber_core/workflow.rb, line 6 def initialize(workflow_service:, druid:, workflow_name:, process:) @workflow_service = workflow_service @druid = druid @workflow_name = workflow_name @process = process end
Public Instance Methods
complete(status, elapsed, note)
click to toggle source
# File lib/lyber_core/workflow.rb, line 22 def complete(status, elapsed, note) workflow_service.update_status(druid: druid, workflow: workflow_name, process: process, status: status, elapsed: elapsed, note: note) end
error(error_msg, error_text)
click to toggle source
# File lib/lyber_core/workflow.rb, line 31 def error(error_msg, error_text) workflow_service.update_error_status(druid: druid, workflow: workflow_name, process: process, error_msg: error_msg, error_text: error_text) end
start(note)
click to toggle source
# File lib/lyber_core/workflow.rb, line 13 def start(note) workflow_service.update_status(druid: druid, workflow: workflow_name, process: process, status: 'started', elapsed: 1.0, note: note) end