Class: Operaton::Bpm::Client::Task::Impl::ExternalTaskImpl
- Inherits:
-
Object
- Object
- Operaton::Bpm::Client::Task::Impl::ExternalTaskImpl
- Includes:
- ExternalTask
- Defined in:
- lib/operaton/bpm/client/task/impl/external_task_impl.rb
Overview
Mirrors org.operaton.bpm.client.task.impl.ExternalTaskImpl
Constant Summary
Constants included from ExternalTask
ExternalTask::INTERFACE_METHODS
Instance Attribute Summary collapse
-
#activity_id ⇒ Object
Returns the value of attribute activity_id.
-
#activity_instance_id ⇒ Object
Returns the value of attribute activity_instance_id.
-
#business_key ⇒ Object
Returns the value of attribute business_key.
-
#create_time ⇒ Object
Returns the value of attribute create_time.
-
#error_details ⇒ Object
Returns the value of attribute error_details.
-
#error_message ⇒ Object
Returns the value of attribute error_message.
-
#execution_id ⇒ Object
Returns the value of attribute execution_id.
-
#id ⇒ Object
Returns the value of attribute id.
-
#lock_expiration_time ⇒ Object
Returns the value of attribute lock_expiration_time.
-
#priority ⇒ Object
Returns the value of attribute priority.
-
#process_definition_id ⇒ Object
Returns the value of attribute process_definition_id.
-
#process_definition_key ⇒ Object
Returns the value of attribute process_definition_key.
-
#process_definition_version_tag ⇒ Object
Returns the value of attribute process_definition_version_tag.
-
#process_instance_id ⇒ Object
Returns the value of attribute process_instance_id.
-
#received_variable_map ⇒ Object
Returns the value of attribute received_variable_map.
-
#retries ⇒ Object
Returns the value of attribute retries.
-
#tenant_id ⇒ Object
Returns the value of attribute tenant_id.
-
#topic_name ⇒ Object
Returns the value of attribute topic_name.
-
#variables ⇒ Object
Returns the value of attribute variables.
-
#worker_id ⇒ Object
Returns the value of attribute worker_id.
Class Method Summary collapse
Instance Method Summary collapse
-
#all_variables ⇒ Object
Mirrors getAllVariables.
-
#all_variables_typed(deserialize_object_values = true) ⇒ Object
Mirrors getAllVariablesTyped.
- #extension_properties ⇒ Object
- #extension_property(property_key) ⇒ Object
-
#initialize ⇒ ExternalTaskImpl
constructor
A new instance of ExternalTaskImpl.
-
#set_extension_properties(extension_properties) ⇒ Object
rubocop:disable Naming/AccessorMethodName.
- #to_s ⇒ Object
-
#variable(variable_name) ⇒ Object
Mirrors getVariable.
-
#variable_typed(variable_name, deserialize_object_values = true) ⇒ Object
Mirrors getVariableTyped.
Constructor Details
#initialize ⇒ ExternalTaskImpl
Returns a new instance of ExternalTaskImpl.
57 58 59 60 61 62 |
# File 'lib/operaton/bpm/client/task/impl/external_task_impl.rb', line 57 def initialize @variables = {} @received_variable_map = {} @extension_properties = nil @priority = 0 end |
Instance Attribute Details
#activity_id ⇒ Object
Returns the value of attribute activity_id.
16 17 18 |
# File 'lib/operaton/bpm/client/task/impl/external_task_impl.rb', line 16 def activity_id @activity_id end |
#activity_instance_id ⇒ Object
Returns the value of attribute activity_instance_id.
16 17 18 |
# File 'lib/operaton/bpm/client/task/impl/external_task_impl.rb', line 16 def activity_instance_id @activity_instance_id end |
#business_key ⇒ Object
Returns the value of attribute business_key.
16 17 18 |
# File 'lib/operaton/bpm/client/task/impl/external_task_impl.rb', line 16 def business_key @business_key end |
#create_time ⇒ Object
Returns the value of attribute create_time.
16 17 18 |
# File 'lib/operaton/bpm/client/task/impl/external_task_impl.rb', line 16 def create_time @create_time end |
#error_details ⇒ Object
Returns the value of attribute error_details.
16 17 18 |
# File 'lib/operaton/bpm/client/task/impl/external_task_impl.rb', line 16 def error_details @error_details end |
#error_message ⇒ Object
Returns the value of attribute error_message.
16 17 18 |
# File 'lib/operaton/bpm/client/task/impl/external_task_impl.rb', line 16 def @error_message end |
#execution_id ⇒ Object
Returns the value of attribute execution_id.
16 17 18 |
# File 'lib/operaton/bpm/client/task/impl/external_task_impl.rb', line 16 def execution_id @execution_id end |
#id ⇒ Object
Returns the value of attribute id.
16 17 18 |
# File 'lib/operaton/bpm/client/task/impl/external_task_impl.rb', line 16 def id @id end |
#lock_expiration_time ⇒ Object
Returns the value of attribute lock_expiration_time.
16 17 18 |
# File 'lib/operaton/bpm/client/task/impl/external_task_impl.rb', line 16 def lock_expiration_time @lock_expiration_time end |
#priority ⇒ Object
Returns the value of attribute priority.
16 17 18 |
# File 'lib/operaton/bpm/client/task/impl/external_task_impl.rb', line 16 def priority @priority end |
#process_definition_id ⇒ Object
Returns the value of attribute process_definition_id.
16 17 18 |
# File 'lib/operaton/bpm/client/task/impl/external_task_impl.rb', line 16 def process_definition_id @process_definition_id end |
#process_definition_key ⇒ Object
Returns the value of attribute process_definition_key.
16 17 18 |
# File 'lib/operaton/bpm/client/task/impl/external_task_impl.rb', line 16 def process_definition_key @process_definition_key end |
#process_definition_version_tag ⇒ Object
Returns the value of attribute process_definition_version_tag.
16 17 18 |
# File 'lib/operaton/bpm/client/task/impl/external_task_impl.rb', line 16 def process_definition_version_tag @process_definition_version_tag end |
#process_instance_id ⇒ Object
Returns the value of attribute process_instance_id.
16 17 18 |
# File 'lib/operaton/bpm/client/task/impl/external_task_impl.rb', line 16 def process_instance_id @process_instance_id end |
#received_variable_map ⇒ Object
Returns the value of attribute received_variable_map.
16 17 18 |
# File 'lib/operaton/bpm/client/task/impl/external_task_impl.rb', line 16 def received_variable_map @received_variable_map end |
#retries ⇒ Object
Returns the value of attribute retries.
16 17 18 |
# File 'lib/operaton/bpm/client/task/impl/external_task_impl.rb', line 16 def retries @retries end |
#tenant_id ⇒ Object
Returns the value of attribute tenant_id.
16 17 18 |
# File 'lib/operaton/bpm/client/task/impl/external_task_impl.rb', line 16 def tenant_id @tenant_id end |
#topic_name ⇒ Object
Returns the value of attribute topic_name.
16 17 18 |
# File 'lib/operaton/bpm/client/task/impl/external_task_impl.rb', line 16 def topic_name @topic_name end |
#variables ⇒ Object
Returns the value of attribute variables.
16 17 18 |
# File 'lib/operaton/bpm/client/task/impl/external_task_impl.rb', line 16 def variables @variables end |
#worker_id ⇒ Object
Returns the value of attribute worker_id.
16 17 18 |
# File 'lib/operaton/bpm/client/task/impl/external_task_impl.rb', line 16 def worker_id @worker_id end |
Class Method Details
.from_json(hash, object_mapper) ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/operaton/bpm/client/task/impl/external_task_impl.rb', line 23 def self.from_json(hash, object_mapper) task = new task.activity_id = hash["activityId"] task.activity_instance_id = hash["activityInstanceId"] task. = hash["errorMessage"] task.error_details = hash["errorDetails"] task.execution_id = hash["executionId"] task.id = hash["id"] task.lock_expiration_time = parse_time(hash["lockExpirationTime"], object_mapper) task.create_time = parse_time(hash["createTime"], object_mapper) task.process_definition_id = hash["processDefinitionId"] task.process_definition_key = hash["processDefinitionKey"] task.process_definition_version_tag = hash["processDefinitionVersionTag"] task.process_instance_id = hash["processInstanceId"] task.retries = hash["retries"] task.worker_id = hash["workerId"] task.topic_name = hash["topicName"] task.tenant_id = hash["tenantId"] task.priority = hash["priority"] || 0 task.business_key = hash["businessKey"] task.variables = (hash["variables"] || {}).transform_values do |field| Variable::Impl::TypedValueField.from_json(field) end task.set_extension_properties(hash["extensionProperties"]) task end |
Instance Method Details
#all_variables ⇒ Object
Mirrors getAllVariables
65 66 67 |
# File 'lib/operaton/bpm/client/task/impl/external_task_impl.rb', line 65 def all_variables received_variable_map.keys.to_h { |name| [name, variable(name)] } end |
#all_variables_typed(deserialize_object_values = true) ⇒ Object
Mirrors getAllVariablesTyped
76 77 78 79 80 81 82 |
# File 'lib/operaton/bpm/client/task/impl/external_task_impl.rb', line 76 def all_variables_typed(deserialize_object_values = true) vars = Engine::Variable::VariableMap.new received_variable_map.each_key do |variable_name| vars.put_value_typed(variable_name, variable_typed(variable_name, deserialize_object_values)) end vars end |
#extension_properties ⇒ Object
90 91 92 |
# File 'lib/operaton/bpm/client/task/impl/external_task_impl.rb', line 90 def extension_properties @extension_properties || {} end |
#extension_property(property_key) ⇒ Object
98 99 100 |
# File 'lib/operaton/bpm/client/task/impl/external_task_impl.rb', line 98 def extension_property(property_key) @extension_properties&.[](property_key) end |
#set_extension_properties(extension_properties) ⇒ Object
rubocop:disable Naming/AccessorMethodName
94 95 96 |
# File 'lib/operaton/bpm/client/task/impl/external_task_impl.rb', line 94 def set_extension_properties(extension_properties) # rubocop:disable Naming/AccessorMethodName @extension_properties = extension_properties end |
#to_s ⇒ Object
102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 |
# File 'lib/operaton/bpm/client/task/impl/external_task_impl.rb', line 102 def to_s "ExternalTaskImpl [" \ "activityId=#{activity_id}, " \ "activityInstanceId=#{activity_instance_id}, " \ "businessKey=#{business_key}, " \ "errorDetails=#{error_details}, " \ "errorMessage=#{}, " \ "executionId=#{execution_id}, " \ "id=#{id}, " \ "lockExpirationTime=#{lock_expiration_time}, " \ "createTime=#{create_time}, " \ "priority=#{priority}, " \ "processDefinitionId=#{process_definition_id}, " \ "processDefinitionKey=#{process_definition_key}, " \ "processDefinitionVersionTag=#{process_definition_version_tag}, " \ "processInstanceId=#{process_instance_id}, " \ "retries=#{retries}, " \ "tenantId=#{tenant_id}, " \ "topicName=#{topic_name}, " \ "workerId=#{worker_id}]" end |
#variable(variable_name) ⇒ Object
Mirrors getVariable
70 71 72 73 |
# File 'lib/operaton/bpm/client/task/impl/external_task_impl.rb', line 70 def variable(variable_name) variable_value = received_variable_map[variable_name] variable_value&.value end |
#variable_typed(variable_name, deserialize_object_values = true) ⇒ Object
Mirrors getVariableTyped
85 86 87 88 |
# File 'lib/operaton/bpm/client/task/impl/external_task_impl.rb', line 85 def variable_typed(variable_name, deserialize_object_values = true) variable_value = received_variable_map[variable_name] variable_value&.typed_value(deserialize_object_values) end |