Class: Camunda::Zeebe::ProcessInstances

Inherits:
API
  • Object
show all
Defined in:
lib/camunda/zeebe/process_instances.rb

Class Method Summary collapse

Methods inherited from API

authentication_headers, client, run

Class Method Details

.create(process_id:, variables: {}, version: -1)) ⇒ Object



6
7
8
9
10
11
12
13
# File 'lib/camunda/zeebe/process_instances.rb', line 6

def self.create(process_id:, variables: {}, version: -1)
  params = {
    bpmnProcessId: process_id,
    variables: variables.to_json,
    version: version
  }
  run(:create_process_instance, ::Zeebe::Client::GatewayProtocol::CreateProcessInstanceRequest.new(params))
end

.update_variables(instance_id:, variables:) ⇒ Object



15
16
17
18
19
20
21
# File 'lib/camunda/zeebe/process_instances.rb', line 15

def self.update_variables(instance_id:, variables:)
  params = {
    elementInstanceKey: instance_id,
    variables: variables.to_json
  }
  run(:set_variables, ::Zeebe::Client::GatewayProtocol::SetVariablesRequest.new(params))
end