Class: Dor::Workflow::Response::Process

Inherits:
Object
  • Object
show all
Extended by:
Deprecation
Defined in:
lib/dor/workflow/response/process.rb

Overview

Represents the status of an object doing a workflow process

Instance Method Summary collapse

Constructor Details

#initialize(parent:, **attributes) ⇒ Process

Returns a new instance of Process.



13
14
15
16
# File 'lib/dor/workflow/response/process.rb', line 13

def initialize(parent:, **attributes)
  @parent = parent
  @attributes = attributes
end

Instance Method Details

#attemptsObject



34
35
36
# File 'lib/dor/workflow/response/process.rb', line 34

def attempts
  @attributes[:attempts].presence
end

#contextHash

Returns the context for the process (or empty hash if none present).

Returns:

  • (Hash)

    the context for the process (or empty hash if none present)



55
56
57
58
59
# File 'lib/dor/workflow/response/process.rb', line 55

def context
  return {} unless @attributes[:context].present?

  JSON.parse(@attributes[:context])
end

#datetimeObject



26
27
28
# File 'lib/dor/workflow/response/process.rb', line 26

def datetime
  @attributes[:datetime].presence
end

#elapsedObject



30
31
32
# File 'lib/dor/workflow/response/process.rb', line 30

def elapsed
  @attributes[:elapsed].presence
end

#error_messageObject



46
47
48
# File 'lib/dor/workflow/response/process.rb', line 46

def error_message
  @attributes[:errorMessage].presence
end

#lane_idObject



50
51
52
# File 'lib/dor/workflow/response/process.rb', line 50

def lane_id
  @attributes[:laneId].presence
end

#lifecycleObject



38
39
40
# File 'lib/dor/workflow/response/process.rb', line 38

def lifecycle
  @attributes[:lifecycle].presence
end

#nameObject



18
19
20
# File 'lib/dor/workflow/response/process.rb', line 18

def name
  @attributes[:name].presence
end

#noteObject



42
43
44
# File 'lib/dor/workflow/response/process.rb', line 42

def note
  @attributes[:note].presence
end

#statusObject



22
23
24
# File 'lib/dor/workflow/response/process.rb', line 22

def status
  @attributes[:status].presence
end