Sha256: e0cdd3140749efd423836b757fd0da552f3f7f4ee277c86015f66782be482cbb

Contents?: true

Size: 677 Bytes

Versions: 3

Compression:

Stored size: 677 Bytes

Contents

module Databasedotcom
  # 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.

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

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

    protected

    def flow_url
      "/services/data/v#{@version}/actions/custom/flow/#{@flow_name}"
    end
  end
end

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
databasedotcom-1.3.5 lib/databasedotcom/flow.rb
databasedotcom-1.3.3 lib/databasedotcom/flow.rb
glg-databasedotcom-1.3.2.1 lib/databasedotcom/flow.rb