Class: Factor::Commands::Workflow

Inherits:
Command
  • Object
show all
Defined in:
lib/commands/workflows.rb

Overview

Workflow is a Command to start the factor runtime from the CLI

Constant Summary

Constants inherited from Command

Command::DEFAULT_FILENAME

Instance Attribute Summary

Attributes inherited from Command

#destination_stream

Instance Method Summary collapse

Methods inherited from Command

#error, #exception, #info, #load_config, #success, #warn

Constructor Details

#initializeWorkflow

Returns a new instance of Workflow.



12
13
14
# File 'lib/commands/workflows.rb', line 12

def initialize
  @workflows = {}
end

Instance Method Details

#server(_args, options) ⇒ Object



16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/commands/workflows.rb', line 16

def server(_args, options)
  config_settings = {}
  config_settings[:credentials] = options.credentials
  config_settings[:connectors]  = options.connectors
  workflow_filename = File.expand_path(options.path || '.')
  @destination_stream = File.new(options.log, 'w+') if options.log

  load_config(config_settings)
  load_all_workflows(workflow_filename)
  block_until_interupt
  log_message 'status' => 'info', 'message' => 'Good bye!'
end