Class: BPMN::ScriptTask

Inherits:
ServiceTask show all
Defined in:
lib/bpmn/task.rb

Instance Attribute Summary

Attributes inherited from ServiceTask

#service

Attributes inherited from Activity

#attachments

Attributes inherited from Step

#default, #default_ref, #incoming, #outgoing

Attributes inherited from Element

#extension_elements, #id, #name

Instance Method Summary collapse

Methods inherited from ServiceTask

#execute, #headers, #is_automated?, #is_manual?, #task_retries, #task_type

Methods inherited from Task

#execute, #is_automated?, #is_manual?, #result_to_variables, #signal

Methods inherited from Activity

#initialize

Methods inherited from Step

#converging?, #diverging?, #initialize, #input_mappings, #leave, #outgoing_flows, #output_mappings

Methods inherited from Element

#initialize, #inspect

Constructor Details

This class inherits a constructor from BPMN::Activity

Instance Method Details

#result_variableObject



103
104
105
# File 'lib/bpmn/task.rb', line 103

def result_variable
  extension_elements&.script&.result_variable
end

#run(execution) ⇒ Object



107
108
109
# File 'lib/bpmn/task.rb', line 107

def run(execution)
  DMN.evaluate(script.delete_prefix("="), variables: execution.parent.variables)
end

#scriptObject



99
100
101
# File 'lib/bpmn/task.rb', line 99

def script
  extension_elements&.script&.expression
end