Class: Ruote::ProcessError
- Inherits:
-
Object
- Object
- Ruote::ProcessError
- Defined in:
- lib/ruote/engine/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::Engine#ps or Ruote::Engine#process, this attribute will point to the flow expression where the error occurred.
Instance Method Summary collapse
-
#action ⇒ Object
‘apply’, ‘reply’, ‘receive’, …
- #at ⇒ 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.
- #message ⇒ Object
- #msg ⇒ Object
- #to_h ⇒ Object
- #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.
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_expression ⇒ Object
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
#action ⇒ Object
‘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 |
#at ⇒ Object
67 68 69 |
# File 'lib/ruote/engine/process_error.rb', line 67 def at @h['msg']['put_at'] end |
#deviations ⇒ Object
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 |
#fei ⇒ Object
55 56 57 |
# File 'lib/ruote/engine/process_error.rb', line 55 def fei Ruote::FlowExpressionId.new(msg['fei']) end |
#fields ⇒ Object
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 |
#message ⇒ Object
43 44 45 |
# File 'lib/ruote/engine/process_error.rb', line 43 def @h['message'] end |
#msg ⇒ Object
51 52 53 |
# File 'lib/ruote/engine/process_error.rb', line 51 def msg @h['msg'] end |
#to_h ⇒ Object
78 79 80 |
# File 'lib/ruote/engine/process_error.rb', line 78 def to_h @h end |
#trace ⇒ Object
47 48 49 |
# File 'lib/ruote/engine/process_error.rb', line 47 def trace @h['trace'] end |
#tree ⇒ Object
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 |
#wfid ⇒ Object
59 60 61 |
# File 'lib/ruote/engine/process_error.rb', line 59 def wfid msg['fei']['wfid'] end |