Class: Ruote::ProcessError

Inherits:
Object
  • Object
show all
Defined in:
lib/ruote/dboard/process_error.rb

Overview

Encapsulating all the information about an error in a process instance.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(h) ⇒ ProcessError

Returns a new instance of ProcessError.



39
40
41
# File 'lib/ruote/dboard/process_error.rb', line 39

def initialize(h)
  @h = h
end

Instance Attribute Details

#flow_expressionObject

When this instance was returned by Ruote::Dashboard#ps or Ruote::Dashboard#process, this attribute will point to the flow expression where the error occurred.



37
38
39
# File 'lib/ruote/dboard/process_error.rb', line 37

def flow_expression
  @flow_expression
end

Instance Method Details

#actionObject

‘apply’, ‘reply’, ‘receive’, … Indicates in which “direction” the error occured.



91
92
93
# File 'lib/ruote/dboard/process_error.rb', line 91

def action
  @h['msg']['action']
end

#atObject



71
72
73
# File 'lib/ruote/dboard/process_error.rb', line 71

def at
  @h['msg']['put_at']
end

#detailsObject



55
56
57
# File 'lib/ruote/dboard/process_error.rb', line 55

def details
  @h['details']
end

#deviationsObject

Returns an array of deviations (see the ‘filter’ expression) if the error is a Ruote::ValidationError.



111
112
113
# File 'lib/ruote/dboard/process_error.rb', line 111

def deviations
  @h['deviations']
end

#feiObject



59
60
61
# File 'lib/ruote/dboard/process_error.rb', line 59

def fei
  Ruote::FlowExpressionId.new(msg['fei'])
end

#fieldsObject

Exposes the workitem fields directly.



97
98
99
# File 'lib/ruote/dboard/process_error.rb', line 97

def fields
  @h['msg']['workitem'] && @h['msg']['workitem']['fields']
end

#messageObject



43
44
45
# File 'lib/ruote/dboard/process_error.rb', line 43

def message
  @h['message']
end

#msgObject



51
52
53
# File 'lib/ruote/dboard/process_error.rb', line 51

def msg
  @h['msg']
end

#to_hObject Also known as: h



82
83
84
# File 'lib/ruote/dboard/process_error.rb', line 82

def to_h
  @h
end

#traceObject



47
48
49
# File 'lib/ruote/dboard/process_error.rb', line 47

def trace
  @h['trace']
end

#treeObject



67
68
69
# File 'lib/ruote/dboard/process_error.rb', line 67

def tree
  @h['msg']['tree']
end

#tree=(t) ⇒ Object

A shortcut for modifying the tree of an expression when it has had an error upon being applied.



78
79
80
# File 'lib/ruote/dboard/process_error.rb', line 78

def tree=(t)
  @h['msg']['tree'] = t
end

#wfidObject



63
64
65
# File 'lib/ruote/dboard/process_error.rb', line 63

def wfid
  msg['fei']['wfid']
end

#workitemObject

Returns an instance of Ruote::Workitem (the workitem as it was at the error point)



104
105
106
# File 'lib/ruote/dboard/process_error.rb', line 104

def workitem
  Ruote::Workitem.new(msg['workitem'])
end