Class: BPMN::SequenceFlow

Inherits:
Flow show all
Defined in:
lib/bpmn/flow.rb

Instance Attribute Summary collapse

Attributes inherited from Flow

#source, #source_ref, #target, #target_ref

Attributes inherited from Element

#extension_elements, #id, #name

Instance Method Summary collapse

Methods inherited from Flow

#inspect

Methods inherited from Element

#inspect

Constructor Details

#initialize(attributes = {}) ⇒ SequenceFlow

Returns a new instance of SequenceFlow.



31
32
33
34
35
# File 'lib/bpmn/flow.rb', line 31

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

  @condition = attributes[:condition_expression]
end

Instance Attribute Details

#conditionObject

Returns the value of attribute condition.



29
30
31
# File 'lib/bpmn/flow.rb', line 29

def condition
  @condition
end

Instance Method Details

#evaluate(execution) ⇒ Object



37
38
39
40
# File 'lib/bpmn/flow.rb', line 37

def evaluate(execution)
  return true unless condition
  execution.evaluate_condition(condition)
end