Class: Ruote::ProcessError

Inherits:
Object
  • Object
show all
Defined in:
lib/ruote/engine/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/engine/process_error.rb', line 39

def initialize(h)
  @h = h
end

Instance Attribute Details

#flow_expressionObject

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



37
38
39
# File 'lib/ruote/engine/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.



85
86
87
# File 'lib/ruote/engine/process_error.rb', line 85

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

#atObject



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

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

#deviationsObject

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



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

def deviations
  @h['deviations']
end

#feiObject



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

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

#fieldsObject

Exposes the workitem fields directly.



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

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

#messageObject



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

def message
  @h['message']
end

#msgObject



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

def msg
  @h['msg']
end

#to_hObject



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

def to_h
  @h
end

#traceObject



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

def trace
  @h['trace']
end

#treeObject



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

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.



74
75
76
# File 'lib/ruote/engine/process_error.rb', line 74

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

#wfidObject



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

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

#workitemObject

Returns an instance of Ruote::Workitem



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

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