Class: Retab::StoredBlockExecution
- Inherits:
-
Types::BaseModel
- Object
- Types::BaseModel
- Retab::StoredBlockExecution
- Defined in:
- lib/retab/workflow_block_executions/stored_block_execution.rb
Constant Summary collapse
- HASH_ATTRS =
{ id: :id, workflow_id: :workflow_id, workflow_version_id: :workflow_version_id, source_run_id: :source_run_id, block_id: :block_id, block_type: :block_type, lifecycle: :lifecycle, handle_inputs: :handle_inputs, artifact: :artifact, handle_outputs: :handle_outputs, routing_decisions: :routing_decisions, duration_ms: :duration_ms, created_at: :created_at, started_at: :started_at, completed_at: :completed_at, handle_inputs_fingerprint: :handle_inputs_fingerprint, workflow_draft_fingerprint: :workflow_draft_fingerprint, block_config_fingerprint: :block_config_fingerprint, execution_fingerprint: :execution_fingerprint, block_config: :block_config, source_step_id: :source_step_id, available_iterations: :available_iterations }.freeze
Instance Attribute Summary collapse
-
#artifact ⇒ Object
Returns the value of attribute artifact.
-
#available_iterations ⇒ Object
Returns the value of attribute available_iterations.
-
#block_config ⇒ Object
Returns the value of attribute block_config.
-
#block_config_fingerprint ⇒ Object
Returns the value of attribute block_config_fingerprint.
-
#block_id ⇒ Object
Returns the value of attribute block_id.
-
#block_type ⇒ Object
Returns the value of attribute block_type.
-
#completed_at ⇒ Object
Returns the value of attribute completed_at.
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#duration_ms ⇒ Object
Returns the value of attribute duration_ms.
-
#execution_fingerprint ⇒ Object
Returns the value of attribute execution_fingerprint.
-
#handle_inputs ⇒ Object
Returns the value of attribute handle_inputs.
-
#handle_inputs_fingerprint ⇒ Object
Returns the value of attribute handle_inputs_fingerprint.
-
#handle_outputs ⇒ Object
Returns the value of attribute handle_outputs.
-
#id ⇒ Object
Returns the value of attribute id.
-
#lifecycle ⇒ Object
Returns the value of attribute lifecycle.
-
#routing_decisions ⇒ Object
Returns the value of attribute routing_decisions.
-
#source_run_id ⇒ Object
Returns the value of attribute source_run_id.
-
#source_step_id ⇒ Object
Returns the value of attribute source_step_id.
-
#started_at ⇒ Object
Returns the value of attribute started_at.
-
#workflow_draft_fingerprint ⇒ Object
Returns the value of attribute workflow_draft_fingerprint.
-
#workflow_id ⇒ Object
Returns the value of attribute workflow_id.
-
#workflow_version_id ⇒ Object
Returns the value of attribute workflow_version_id.
Attributes inherited from Types::BaseModel
Instance Method Summary collapse
-
#initialize(json) ⇒ StoredBlockExecution
constructor
A new instance of StoredBlockExecution.
Methods inherited from Types::BaseModel
deep_symbolize, #inspect, normalize, #to_h, #to_json
Constructor Details
#initialize(json) ⇒ StoredBlockExecution
Returns a new instance of StoredBlockExecution.
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 |
# File 'lib/retab/workflow_block_executions/stored_block_execution.rb', line 58 def initialize(json) super() hash = self.class.normalize(json) @id = hash[:id] @workflow_id = hash[:workflow_id] @workflow_version_id = hash[:workflow_version_id] @source_run_id = hash[:source_run_id] @block_id = hash[:block_id] @block_type = hash[:block_type] @lifecycle = hash[:lifecycle] ? ( case hash[:lifecycle][:status] when "cancelled" Retab::CancelledBlockExecutionLifecycle.new(hash[:lifecycle]) when "completed" Retab::CompletedBlockExecutionLifecycle.new(hash[:lifecycle]) when "error" Retab::ErrorBlockExecutionLifecycle.new(hash[:lifecycle]) when "pending" Retab::PendingBlockExecutionLifecycle.new(hash[:lifecycle]) when "queued" Retab::QueuedBlockExecutionLifecycle.new(hash[:lifecycle]) when "running" Retab::RunningBlockExecutionLifecycle.new(hash[:lifecycle]) when "skipped" Retab::SkippedBlockExecutionLifecycle.new(hash[:lifecycle]) else hash[:lifecycle] end ) : nil @handle_inputs = hash[:handle_inputs] || {} @artifact = hash[:artifact] ? Retab::StepArtifactRef.new(hash[:artifact]) : nil @handle_outputs = hash[:handle_outputs] || {} @routing_decisions = (hash[:routing_decisions] || []) @duration_ms = hash[:duration_ms] @created_at = hash[:created_at] @started_at = hash[:started_at] @completed_at = hash[:completed_at] @handle_inputs_fingerprint = hash[:handle_inputs_fingerprint] @workflow_draft_fingerprint = hash[:workflow_draft_fingerprint] @block_config_fingerprint = hash[:block_config_fingerprint] @execution_fingerprint = hash[:execution_fingerprint] @block_config = hash[:block_config] || {} @source_step_id = hash[:source_step_id] @available_iterations = (hash[:available_iterations] || []).map { |item| item || {} } end |
Instance Attribute Details
#artifact ⇒ Object
Returns the value of attribute artifact.
33 34 35 |
# File 'lib/retab/workflow_block_executions/stored_block_execution.rb', line 33 def artifact @artifact end |
#available_iterations ⇒ Object
Returns the value of attribute available_iterations.
33 34 35 |
# File 'lib/retab/workflow_block_executions/stored_block_execution.rb', line 33 def available_iterations @available_iterations end |
#block_config ⇒ Object
Returns the value of attribute block_config.
33 34 35 |
# File 'lib/retab/workflow_block_executions/stored_block_execution.rb', line 33 def block_config @block_config end |
#block_config_fingerprint ⇒ Object
Returns the value of attribute block_config_fingerprint.
33 34 35 |
# File 'lib/retab/workflow_block_executions/stored_block_execution.rb', line 33 def block_config_fingerprint @block_config_fingerprint end |
#block_id ⇒ Object
Returns the value of attribute block_id.
33 34 35 |
# File 'lib/retab/workflow_block_executions/stored_block_execution.rb', line 33 def block_id @block_id end |
#block_type ⇒ Object
Returns the value of attribute block_type.
33 34 35 |
# File 'lib/retab/workflow_block_executions/stored_block_execution.rb', line 33 def block_type @block_type end |
#completed_at ⇒ Object
Returns the value of attribute completed_at.
33 34 35 |
# File 'lib/retab/workflow_block_executions/stored_block_execution.rb', line 33 def completed_at @completed_at end |
#created_at ⇒ Object
Returns the value of attribute created_at.
33 34 35 |
# File 'lib/retab/workflow_block_executions/stored_block_execution.rb', line 33 def created_at @created_at end |
#duration_ms ⇒ Object
Returns the value of attribute duration_ms.
33 34 35 |
# File 'lib/retab/workflow_block_executions/stored_block_execution.rb', line 33 def duration_ms @duration_ms end |
#execution_fingerprint ⇒ Object
Returns the value of attribute execution_fingerprint.
33 34 35 |
# File 'lib/retab/workflow_block_executions/stored_block_execution.rb', line 33 def execution_fingerprint @execution_fingerprint end |
#handle_inputs ⇒ Object
Returns the value of attribute handle_inputs.
33 34 35 |
# File 'lib/retab/workflow_block_executions/stored_block_execution.rb', line 33 def handle_inputs @handle_inputs end |
#handle_inputs_fingerprint ⇒ Object
Returns the value of attribute handle_inputs_fingerprint.
33 34 35 |
# File 'lib/retab/workflow_block_executions/stored_block_execution.rb', line 33 def handle_inputs_fingerprint @handle_inputs_fingerprint end |
#handle_outputs ⇒ Object
Returns the value of attribute handle_outputs.
33 34 35 |
# File 'lib/retab/workflow_block_executions/stored_block_execution.rb', line 33 def handle_outputs @handle_outputs end |
#id ⇒ Object
Returns the value of attribute id.
33 34 35 |
# File 'lib/retab/workflow_block_executions/stored_block_execution.rb', line 33 def id @id end |
#lifecycle ⇒ Object
Returns the value of attribute lifecycle.
33 34 35 |
# File 'lib/retab/workflow_block_executions/stored_block_execution.rb', line 33 def lifecycle @lifecycle end |
#routing_decisions ⇒ Object
Returns the value of attribute routing_decisions.
33 34 35 |
# File 'lib/retab/workflow_block_executions/stored_block_execution.rb', line 33 def routing_decisions @routing_decisions end |
#source_run_id ⇒ Object
Returns the value of attribute source_run_id.
33 34 35 |
# File 'lib/retab/workflow_block_executions/stored_block_execution.rb', line 33 def source_run_id @source_run_id end |
#source_step_id ⇒ Object
Returns the value of attribute source_step_id.
33 34 35 |
# File 'lib/retab/workflow_block_executions/stored_block_execution.rb', line 33 def source_step_id @source_step_id end |
#started_at ⇒ Object
Returns the value of attribute started_at.
33 34 35 |
# File 'lib/retab/workflow_block_executions/stored_block_execution.rb', line 33 def started_at @started_at end |
#workflow_draft_fingerprint ⇒ Object
Returns the value of attribute workflow_draft_fingerprint.
33 34 35 |
# File 'lib/retab/workflow_block_executions/stored_block_execution.rb', line 33 def workflow_draft_fingerprint @workflow_draft_fingerprint end |
#workflow_id ⇒ Object
Returns the value of attribute workflow_id.
33 34 35 |
# File 'lib/retab/workflow_block_executions/stored_block_execution.rb', line 33 def workflow_id @workflow_id end |
#workflow_version_id ⇒ Object
Returns the value of attribute workflow_version_id.
33 34 35 |
# File 'lib/retab/workflow_block_executions/stored_block_execution.rb', line 33 def workflow_version_id @workflow_version_id end |