Class: Temporalio::Workflow::Definition::Info
- Inherits:
-
Object
- Object
- Temporalio::Workflow::Definition::Info
- Defined in:
- lib/temporalio/workflow/definition.rb
Overview
Information about the workflow definition. This is usually not used directly.
Instance Attribute Summary collapse
-
#dynamic ⇒ Object
readonly
Returns the value of attribute dynamic.
-
#failure_exception_types ⇒ Object
readonly
Returns the value of attribute failure_exception_types.
-
#init ⇒ Object
readonly
Returns the value of attribute init.
-
#override_name ⇒ Object
readonly
Returns the value of attribute override_name.
-
#queries ⇒ Object
readonly
Returns the value of attribute queries.
-
#raw_args ⇒ Object
readonly
Returns the value of attribute raw_args.
-
#signals ⇒ Object
readonly
Returns the value of attribute signals.
-
#updates ⇒ Object
readonly
Returns the value of attribute updates.
-
#workflow_class ⇒ Object
readonly
Returns the value of attribute workflow_class.
Class Method Summary collapse
-
.from_class(workflow_class) ⇒ Info
Derive the workflow definition info from the class.
Instance Method Summary collapse
-
#initialize(workflow_class:, override_name: nil, dynamic: false, init: false, raw_args: false, failure_exception_types: [], signals: {}, queries: {}, updates: {}) ⇒ Info
constructor
Create a definition info.
-
#name ⇒ String
Workflow name.
Constructor Details
#initialize(workflow_class:, override_name: nil, dynamic: false, init: false, raw_args: false, failure_exception_types: [], signals: {}, queries: {}, updates: {}) ⇒ Info
Create a definition info. This should usually not be used directly, but instead a class that extends Temporalio::Workflow::Definition should be used.
413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 |
# File 'lib/temporalio/workflow/definition.rb', line 413 def initialize( workflow_class:, override_name: nil, dynamic: false, init: false, raw_args: false, failure_exception_types: [], signals: {}, queries: {}, updates: {} ) @workflow_class = workflow_class @override_name = override_name @dynamic = dynamic @init = init @raw_args = raw_args @failure_exception_types = failure_exception_types.dup.freeze @signals = signals.dup.freeze @queries = queries.dup.freeze @updates = updates.dup.freeze end |
Instance Attribute Details
#dynamic ⇒ Object (readonly)
Returns the value of attribute dynamic.
396 397 398 |
# File 'lib/temporalio/workflow/definition.rb', line 396 def dynamic @dynamic end |
#failure_exception_types ⇒ Object (readonly)
Returns the value of attribute failure_exception_types.
396 397 398 |
# File 'lib/temporalio/workflow/definition.rb', line 396 def failure_exception_types @failure_exception_types end |
#init ⇒ Object (readonly)
Returns the value of attribute init.
396 397 398 |
# File 'lib/temporalio/workflow/definition.rb', line 396 def init @init end |
#override_name ⇒ Object (readonly)
Returns the value of attribute override_name.
396 397 398 |
# File 'lib/temporalio/workflow/definition.rb', line 396 def override_name @override_name end |
#queries ⇒ Object (readonly)
Returns the value of attribute queries.
396 397 398 |
# File 'lib/temporalio/workflow/definition.rb', line 396 def queries @queries end |
#raw_args ⇒ Object (readonly)
Returns the value of attribute raw_args.
396 397 398 |
# File 'lib/temporalio/workflow/definition.rb', line 396 def raw_args @raw_args end |
#signals ⇒ Object (readonly)
Returns the value of attribute signals.
396 397 398 |
# File 'lib/temporalio/workflow/definition.rb', line 396 def signals @signals end |
#updates ⇒ Object (readonly)
Returns the value of attribute updates.
396 397 398 |
# File 'lib/temporalio/workflow/definition.rb', line 396 def updates @updates end |
#workflow_class ⇒ Object (readonly)
Returns the value of attribute workflow_class.
396 397 398 |
# File 'lib/temporalio/workflow/definition.rb', line 396 def workflow_class @workflow_class end |
Class Method Details
.from_class(workflow_class) ⇒ Info
Derive the workflow definition info from the class.
403 404 405 406 407 408 409 |
# File 'lib/temporalio/workflow/definition.rb', line 403 def self.from_class(workflow_class) unless workflow_class.is_a?(Class) && workflow_class < Definition raise "Workflow '#{workflow_class}' must be a class and must extend Temporalio::Workflow::Definition" end workflow_class._workflow_definition end |
Instance Method Details
#name ⇒ String
Returns Workflow name.
436 437 438 |
# File 'lib/temporalio/workflow/definition.rb', line 436 def name dynamic ? nil : (override_name || workflow_class.name.to_s.split('::').last) end |