Class: ProcessEngine::Schema::Interceptor::ExclusiveGateway

Inherits:
Object
  • Object
show all
Defined in:
app/models/process_engine/schema/interceptor/exclusive_gateway.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(node, options) ⇒ ExclusiveGateway

Returns a new instance of ExclusiveGateway.



5
6
7
8
# File 'app/models/process_engine/schema/interceptor/exclusive_gateway.rb', line 5

def initialize(node, options)
  @node = node
  @options = options
end

Instance Attribute Details

#nodeObject (readonly)

Returns the value of attribute node.



3
4
5
# File 'app/models/process_engine/schema/interceptor/exclusive_gateway.rb', line 3

def node
  @node
end

#optionsObject (readonly)

Returns the value of attribute options.



3
4
5
# File 'app/models/process_engine/schema/interceptor/exclusive_gateway.rb', line 3

def options
  @options
end

Class Method Details

.execute(node, options) ⇒ Object



21
22
23
# File 'app/models/process_engine/schema/interceptor/exclusive_gateway.rb', line 21

def self.execute(node, options)
  new(node, options).execute
end

Instance Method Details

#executeObject



10
11
12
13
14
15
16
17
18
19
# File 'app/models/process_engine/schema/interceptor/exclusive_gateway.rb', line 10

def execute
  # get the next branch from the options implemented
  next_node = target_of_next_sequence_flow(options[:exclusive_gateway_choice_value])

  # choose the default flow if not implemented
  next_node = choose_default_flow unless next_node

  return [] unless next_node # the flow get stuck if no implementation given or no default path
  [next_node]
end