lib/ruote/engine.rb in ruote-2.1.4 vs lib/ruote/engine.rb in ruote-2.1.5
- old
+ new
@@ -111,18 +111,11 @@
#
exp = Ruote::Exp::FlowExpression.fetch(@context, fei)
exp.unpersist_or_raise if exp
end
- #@storage.delete(err.to_h) # remove error
- #
- # done when the expression gets deleted
- #
- # but
- #
- # is there a case, 5 lines above, where there is no expression
- # to delete ?
+ @storage.delete(err.to_h) # remove error
@storage.put_msg(action, msg) # trigger replay
end
# Re-applies an expression (given via its FlowExpressionId).
@@ -139,15 +132,15 @@
# Returns a ProcessStatus instance describing the current status of
# a process instance.
#
def process (wfid)
- exps = @storage.get_many('expressions', /#{wfid}$/)
+ exps = @storage.get_many('expressions', /!#{wfid}$/)
+ errs = @storage.get_many('errors', /!#{wfid}$/)
- return nil if exps.size < 1
+ return nil if exps.empty? && errs.empty?
- ProcessStatus.new(
- @context, exps, @storage.get_many('errors', /#{wfid}$/))
+ ProcessStatus.new(@context, exps, errs)
end
# Returns an array of ProcessStatus instances.
#
# WARNING : this is an expensive operation.