Class: DurableFlow::WorkflowRunsController

Inherits:
ActionController::Base
  • Object
show all
Defined in:
app/controllers/durable_flow/workflow_runs_controller.rb

Instance Method Summary collapse

Instance Method Details

#indexObject



12
13
14
15
16
# File 'app/controllers/durable_flow/workflow_runs_controller.rb', line 12

def index
  @workflow_runs = WorkflowRun.order(created_at: :desc).limit(100)
  @status_counts = @workflow_runs.group_by(&:status).transform_values(&:count)
  @active_count = @workflow_runs.count { |run| !run.terminal? }
end

#showObject



18
19
20
21
# File 'app/controllers/durable_flow/workflow_runs_controller.rb', line 18

def show
  @workflow_run = WorkflowRun.find_by!(run_id: params[:run_id])
  @workflow_timeline = @workflow_run.timeline
end