Class: Camunda::Task
- Includes:
- VariableSerialization
- Defined in:
- lib/camunda/task.rb
Overview
Finds tasks by business key and task definition and allows you to report a task complete and update process variables. If a business key isn’t supplied when creating a process definition, you can still retrieve UserTasks by using the ‘.find_by` helper provided by Her.
Defined Under Namespace
Classes: SubmissionError
Class Method Summary collapse
Instance Method Summary collapse
-
#complete!(vars = {}) ⇒ Object
Complete a task and updates process variables.
Methods included from VariableSerialization
Methods inherited from Model
Class Method Details
.find_by_business_key_and_task_definition_key!(instance_business_key, task_key) ⇒ Camunda::Task
22 23 24 |
# File 'lib/camunda/task.rb', line 22 def self.find_by_business_key_and_task_definition_key!(instance_business_key, task_key) find_by!(processInstanceBusinessKey: instance_business_key, taskDefinitionKey: task_key) end |
Instance Method Details
#complete!(vars = {}) ⇒ Object
Complete a task and updates process variables.
31 32 33 34 35 36 |
# File 'lib/camunda/task.rb', line 31 def complete!(vars={}) self.class.post_raw("#{self.class.collection_path}/#{id}/complete", variables: serialize_variables(vars))[:response] .tap do |response| raise SubmissionError, response.body[:data][:message] unless response.success? end end |