class Bumbleworks::Expression

Attributes

expid[R]
fei[R]
id[R]

Public Class Methods

from_fei(fei) click to toggle source
# File lib/bumbleworks/expression.rb, line 9
def from_fei(fei)
  fexp = ::Ruote::Exp::FlowExpression.fetch(Bumbleworks.dashboard.context, fei)
  new(fexp)
end
new(flow_expression) click to toggle source
# 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!() click to toggle source

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
error() click to toggle source

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!() click to toggle source

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
process() click to toggle source

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
tree() click to toggle source

Returns the process tree at this expression.

# File lib/bumbleworks/expression.rb, line 29
def tree
  @flow_expression.tree
end
workitem() click to toggle source

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

ruote_error() click to toggle source
# File lib/bumbleworks/expression.rb, line 68
def ruote_error
  process.errors.detect { |err| err.fei == @fei }
end