Class: Bumbleworks::Expression
- Inherits:
-
Object
- Object
- Bumbleworks::Expression
- Includes:
- Support::WrapperComparison
- Defined in:
- lib/bumbleworks/expression.rb
Instance Attribute Summary collapse
-
#expid ⇒ Object
(also: #id)
readonly
Returns the value of attribute expid.
-
#fei ⇒ Object
readonly
Returns the value of attribute fei.
Class Method Summary collapse
Instance Method Summary collapse
-
#cancel! ⇒ Object
Cancel this expression.
-
#error ⇒ Object
Returns a Bumbleworks::Process::ErrorRecord instance for the expression’s error, if there is one.
-
#initialize(flow_expression) ⇒ Expression
constructor
A new instance of Expression.
-
#kill! ⇒ Object
Kill this expression.
-
#process ⇒ Object
Returns a Bumbleworks::Process instance for the expression’s wfid; effectively, the process instance this expression is a part of.
-
#tree ⇒ Object
Returns the process tree at this expression.
-
#workitem ⇒ Object
Returns the workitem as it was applied to this expression.
Methods included from Support::WrapperComparison
#==, #eql?, #hash, #identifier_for_comparison
Constructor Details
#initialize(flow_expression) ⇒ Expression
Returns a new instance of Expression.
15 16 17 18 19 |
# File 'lib/bumbleworks/expression.rb', line 15 def initialize(flow_expression) @flow_expression = flow_expression @fei = @flow_expression.fei @expid = @fei.expid end |
Instance Attribute Details
#expid ⇒ Object (readonly) Also known as: id
Returns the value of attribute expid.
5 6 7 |
# File 'lib/bumbleworks/expression.rb', line 5 def expid @expid end |
#fei ⇒ Object (readonly)
Returns the value of attribute fei.
5 6 7 |
# File 'lib/bumbleworks/expression.rb', line 5 def fei @fei end |
Class Method Details
.from_fei(fei) ⇒ Object
9 10 11 12 |
# File 'lib/bumbleworks/expression.rb', line 9 def from_fei(fei) fexp = ::Ruote::Exp::FlowExpression.fetch(Bumbleworks.dashboard.context, fei) new(fexp) end |
Instance Method Details
#cancel! ⇒ Object
Cancel this expression. The process will then move on to the next expression.
47 48 49 |
# File 'lib/bumbleworks/expression.rb', line 47 def cancel! Bumbleworks.dashboard.cancel_expression(@fei) end |
#error ⇒ Object
Returns a Bumbleworks::Process::ErrorRecord instance for the expression’s error, if there is one. If no error was raised during the execution of this expression, returns nil.
Note that what is returned is not the exception itself that was raised during execution, but rather a record of that error. If you want a re-created instance of the actual exception, you can call #reify on the ErrorRecord instance returned.
41 42 43 |
# File 'lib/bumbleworks/expression.rb', line 41 def error @error ||= ruote_error end |
#kill! ⇒ Object
Kill this expression. The process will then move on to the next expression.
WARNING: Killing an expression will not trigger any ‘on_cancel’ callbacks. It’s preferable to #cancel! the expression if you can.
57 58 59 |
# File 'lib/bumbleworks/expression.rb', line 57 def kill! Bumbleworks.dashboard.kill_expression(@fei) end |
#process ⇒ Object
Returns a Bumbleworks::Process instance for the expression’s wfid; effectively, the process instance this expression is a part of.
24 25 26 |
# File 'lib/bumbleworks/expression.rb', line 24 def process @process ||= Bumbleworks::Process.new(@fei.wfid) end |
#tree ⇒ Object
Returns the process tree at this expression.
29 30 31 |
# File 'lib/bumbleworks/expression.rb', line 29 def tree @flow_expression.tree end |