Class: BPMN::ErrorEventDefinition

Inherits:
EventDefinition show all
Defined in:
lib/bpmn/event_definition.rb

Instance Attribute Summary collapse

Attributes inherited from Element

#extension_elements, #id, #name

Instance Method Summary collapse

Methods inherited from Element

#inspect

Constructor Details

#initialize(attributes = {}) ⇒ ErrorEventDefinition

Returns a new instance of ErrorEventDefinition.



28
29
30
31
32
33
34
# File 'lib/bpmn/event_definition.rb', line 28

def initialize(attributes = {})
  super(attributes.except(:error_ref, :error_code_variable, :error_message_variable))

  @error_ref = attributes[:error_ref]
  @error_code_variable = attributes[:error_code_variable]
  @error_message_variable = attributes[:error_message_variable]
end

Instance Attribute Details

#errorObject

Returns the value of attribute error.



25
26
27
# File 'lib/bpmn/event_definition.rb', line 25

def error
  @error
end

#error_code_variableObject

Returns the value of attribute error_code_variable.



26
27
28
# File 'lib/bpmn/event_definition.rb', line 26

def error_code_variable
  @error_code_variable
end

#error_message_variableObject

Returns the value of attribute error_message_variable.



26
27
28
# File 'lib/bpmn/event_definition.rb', line 26

def error_message_variable
  @error_message_variable
end

#error_refObject

Returns the value of attribute error_ref.



25
26
27
# File 'lib/bpmn/event_definition.rb', line 25

def error_ref
  @error_ref
end

Instance Method Details

#error_idObject



44
45
46
# File 'lib/bpmn/event_definition.rb', line 44

def error_id
  error&.id
end

#error_nameObject



48
49
50
# File 'lib/bpmn/event_definition.rb', line 48

def error_name
  error&.name
end

#execute(execution) ⇒ Object



36
37
38
39
40
41
42
# File 'lib/bpmn/event_definition.rb', line 36

def execute(execution)
  if execution.step.is_throwing?
    execution.throw_error(error_name)
  else
    execution.error_names.push error_name
  end
end