Class: ConvenientService::Service::Plugins::CanHaveConnectedSteps::Middleware

Inherits:
MethodChainMiddleware
  • Object
show all
Defined in:
lib/convenient_service/service/plugins/can_have_connected_steps/middleware.rb

Instance Method Summary collapse

Instance Method Details

#nextConvenientService::Service::Plugins::HasJSendResult::Entities::Result



13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/convenient_service/service/plugins/can_have_connected_steps/middleware.rb', line 13

def next(...)
  return chain.next(...) if entity.steps.none?

  entity.steps.each_evaluated_step do |step|
    step.save_outputs_in_organizer!

    step.trigger_callback

    step.mark_as_completed!
  end

  entity.steps.result
end