Class: BPMN::MessageEventDefinition

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 = {}) ⇒ MessageEventDefinition

Returns a new instance of MessageEventDefinition.



79
80
81
82
83
# File 'lib/bpmn/event_definition.rb', line 79

def initialize(attributes = {})
  super(attributes.except(:message_ref))

  @message_ref = attributes[:message_ref]
end

Instance Attribute Details

#messageObject

Returns the value of attribute message.



77
78
79
# File 'lib/bpmn/event_definition.rb', line 77

def message
  @message
end

#message_refObject

Returns the value of attribute message_ref.



77
78
79
# File 'lib/bpmn/event_definition.rb', line 77

def message_ref
  @message_ref
end

Instance Method Details

#execute(execution) ⇒ Object



85
86
87
88
89
90
91
# File 'lib/bpmn/event_definition.rb', line 85

def execute(execution)
  if execution.step.is_throwing?
    execution.throw_message(message_name)
  else
    execution.message_names.push message_name
  end
end

#message_idObject



93
94
95
# File 'lib/bpmn/event_definition.rb', line 93

def message_id
  message&.id
end

#message_nameObject



97
98
99
# File 'lib/bpmn/event_definition.rb', line 97

def message_name
  message&.name
end