class Bumbleworks::Expression
Attributes
Public Class Methods
# File lib/bumbleworks/expression.rb, line 9 def from_fei(fei) fexp = ::Ruote::Exp::FlowExpression.fetch(Bumbleworks.dashboard.context, fei) new(fexp) end
# File lib/bumbleworks/expression.rb, line 15 def initialize(flow_expression) @flow_expression = flow_expression @fei = @flow_expression.fei @expid = @fei.expid end
Public Instance Methods
Cancel this expression. The process will then move on to the next expression.
# File lib/bumbleworks/expression.rb, line 47 def cancel! Bumbleworks.dashboard.cancel_expression(@fei) end
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.
# File lib/bumbleworks/expression.rb, line 41 def error @error ||= ruote_error end
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.
# File lib/bumbleworks/expression.rb, line 57 def kill! Bumbleworks.dashboard.kill_expression(@fei) end
Returns a Bumbleworks::Process
instance for the expression's wfid; effectively, the process instance this expression is a part of.
# File lib/bumbleworks/expression.rb, line 24 def process @process ||= Bumbleworks::Process.new(@fei.wfid) end
Returns the process tree at this expression.
# File lib/bumbleworks/expression.rb, line 29 def tree @flow_expression.tree end
Returns the workitem as it was applied to this expression.
# File lib/bumbleworks/expression.rb, line 62 def workitem Workitem.new(@flow_expression.applied_workitem) end
Private Instance Methods
# File lib/bumbleworks/expression.rb, line 68 def ruote_error process.errors.detect { |err| err.fei == @fei } end