Class: Ruote::ProcessError
- Inherits:
-
Object
- Object
- Ruote::ProcessError
- Defined in:
- lib/ruote/dboard/process_error.rb
Overview
Encapsulating all the information about an error in a process instance.
Instance Attribute Summary collapse
-
#flow_expression ⇒ Object
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.
Instance Method Summary collapse
-
#action ⇒ Object
'apply', 'reply', 'receive', …
- #at ⇒ Object
- #details ⇒ Object
-
#deviations ⇒ Object
Returns an array of deviations (see the 'filter' expression) if the error is a Ruote::ValidationError.
- #fei ⇒ Object
-
#fields ⇒ Object
Exposes the workitem fields directly.
-
#initialize(h) ⇒ ProcessError
constructor
A new instance of ProcessError.
- #klass ⇒ Object
- #message ⇒ Object
- #msg ⇒ Object
- #to_h ⇒ Object (also: #h)
- #trace ⇒ Object
- #tree ⇒ Object
-
#tree=(t) ⇒ Object
A shortcut for modifying the tree of an expression when it has had an error upon being applied.
- #wfid ⇒ Object
-
#workitem ⇒ Object
Returns an instance of Ruote::Workitem (the workitem as it was at the error point).
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_expression ⇒ Object
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
#action ⇒ Object
'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 |
#at ⇒ Object
49 |
# File 'lib/ruote/dboard/process_error.rb', line 49 def at; @h['msg']['put_at']; end |
#details ⇒ Object
47 |
# File 'lib/ruote/dboard/process_error.rb', line 47 def details; @h['details']; end |
#deviations ⇒ Object
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 |
#fei ⇒ Object
63 64 65 |
# File 'lib/ruote/dboard/process_error.rb', line 63 def fei Ruote::FlowExpressionId.new(msg['fei']) end |
#fields ⇒ Object
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 |
#klass ⇒ Object
43 |
# File 'lib/ruote/dboard/process_error.rb', line 43 def klass; @h['class']; end |
#message ⇒ Object
44 |
# File 'lib/ruote/dboard/process_error.rb', line 44 def ; @h['message']; end |
#msg ⇒ Object
46 |
# File 'lib/ruote/dboard/process_error.rb', line 46 def msg; @h['msg']; end |
#to_h ⇒ Object Also known as: h
74 75 76 |
# File 'lib/ruote/dboard/process_error.rb', line 74 def to_h @h end |
#trace ⇒ Object
45 |
# File 'lib/ruote/dboard/process_error.rb', line 45 def trace; @h['trace']; end |
#tree ⇒ Object
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 |
#wfid ⇒ Object
51 |
# File 'lib/ruote/dboard/process_error.rb', line 51 def wfid; msg['fei']['wfid']; end |
#workitem ⇒ Object
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 |