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


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.


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

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

#atObject


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

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

#detailsObject


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

def details;  @h['details']; end

#deviationsObject

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


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

def deviations; @h['deviations']; end

#feiObject


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

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

#fieldsObject

Exposes the workitem fields directly.


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

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

#klassObject


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

def klass;    @h['class']; end

#messageObject


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

def message;  @h['message']; end

#msgObject


46
# File 'lib/ruote/dboard/process_error.rb', line 46

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

#to_hObject Also known as: h


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

def to_h
  @h
end

#traceObject


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

def trace;    @h['trace']; end

#treeObject


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

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.


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

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

#wfidObject


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

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

#workitemObject

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


89
90
91
# File 'lib/ruote/dboard/process_error.rb', line 89

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