Class: Conductor::Workflow::Dsl::InputRef

Inherits:
Object
  • Object
show all
Defined in:
lib/conductor/workflow/dsl/input_ref.rb

Overview

InputRef provides access to workflow inputs and variables wf => "$workflowworkflow.inputworkflow.input.order_id" wf.var(:counter) => "$workflowworkflow.variablesworkflow.variables.counter"

Instance Method Summary collapse

Instance Method Details

#[](field) ⇒ OutputRef

Access workflow input by field name

Parameters:

  • field (String, Symbol)

    The input field name

Returns:

  • (OutputRef)

    An OutputRef pointing to the workflow input



13
14
15
# File 'lib/conductor/workflow/dsl/input_ref.rb', line 13

def [](field)
  OutputRef.new("workflow.input.#{field}")
end

#output(field = nil) ⇒ OutputRef

Access workflow output (for sub-workflows)

Parameters:

  • field (String, Symbol, nil) (defaults to: nil)

    Optional field name

Returns:

  • (OutputRef)

    An OutputRef pointing to workflow output



27
28
29
30
31
32
33
# File 'lib/conductor/workflow/dsl/input_ref.rb', line 27

def output(field = nil)
  if field
    OutputRef.new("workflow.output.#{field}")
  else
    OutputRef.new('workflow.output')
  end
end

#var(name) ⇒ OutputRef

Access workflow variable by name

Parameters:

  • name (String, Symbol)

    The variable name

Returns:

  • (OutputRef)

    An OutputRef pointing to the workflow variable



20
21
22
# File 'lib/conductor/workflow/dsl/input_ref.rb', line 20

def var(name)
  OutputRef.new("workflow.variables.#{name}")
end