Class: Databasedotcom::Flow

Inherits:
Object
  • Object
show all
Defined in:
lib/databasedotcom/flow.rb

Overview

A Salesforce API endpoint that can trigger predefinted flows in salesforce to kick off salesforce side processes. A flow can be triggered by its unique name and can be passed a hash of input variables.

Instance Method Summary collapse

Constructor Details

#initialize(client, flow_name, params = {}, options = {}) ⇒ Flow

Returns a new instance of Flow.



6
7
8
9
10
11
# File 'lib/databasedotcom/flow.rb', line 6

def initialize(client, flow_name, params = {}, options = {})
  @client = client
  @flow_name = flow_name
  @params = params
  @version = options[:version] || '32.0'
end

Instance Method Details

#runObject



13
14
15
16
# File 'lib/databasedotcom/flow.rb', line 13

def run
  params_hash = {inputs: [@params]}
  @client.http_post(flow_url, params_hash.to_json)
end