Class: SpotFlow::Bpmn::SequenceFlow

Inherits:
Flow show all
Defined in:
lib/spot_flow/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.



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

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

  @condition = attributes[:condition_expression]
end

Instance Attribute Details

#conditionObject

Returns the value of attribute condition.



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

def condition
  @condition
end

Instance Method Details

#evaluate(execution) ⇒ Object



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

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