Class: FlowCore::Steps::ExclusiveChoice

Inherits:
FlowCore::Step show all
Defined in:
app/models/flow_core/steps/exclusive_choice.rb

Instance Attribute Summary

Attributes inherited from FlowCore::Step

#append_to

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from FlowCore::Step

#barrier_step?, barrier_step?, branch_arc_guard_attachable?, #branch_configurable?, fallback_branch_required?, #multi_branch_step?, #redirectable_steps, #redirection_configurable?, redirection_configurable?, redirection_step?, #redirection_step?, #transition_callback_attachable?, transition_trigger_attachable?, transition_trigger_required?, #transition_trigger_required?

Class Method Details

.branch_configurable?Boolean

Returns:



60
61
62
# File 'app/models/flow_core/steps/exclusive_choice.rb', line 60

def branch_configurable?
  true
end

.creatable?Boolean

Returns:



48
49
50
# File 'app/models/flow_core/steps/exclusive_choice.rb', line 48

def creatable?
  true
end

.multi_branch_step?Boolean

Returns:



52
53
54
# File 'app/models/flow_core/steps/exclusive_choice.rb', line 52

def multi_branch_step?
  true
end

.transition_callback_attachable?Boolean

Returns:



56
57
58
# File 'app/models/flow_core/steps/exclusive_choice.rb', line 56

def transition_callback_attachable?
  true
end

Instance Method Details

#branch_arc_guard_attachable?Boolean

Returns:



39
40
41
# File 'app/models/flow_core/steps/exclusive_choice.rb', line 39

def branch_arc_guard_attachable?
  true
end

#deploy_to_workflow!(workflow, input_transition) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'app/models/flow_core/steps/exclusive_choice.rb', line 7

def deploy_to_workflow!(workflow, input_transition)
  return input_transition if branches.empty?

  input_place = find_or_create_input_place(workflow, input_transition)
  exclusive_choice_transition =
    if transition_trigger
      t = input_place.output_transitions.create! workflow: workflow,
                                                 name: name,
                                                 output_token_create_strategy: :match_one_or_fallback,
                                                 generated_by_step_id: id
      copy_transition_trigger_to t
      copy_transition_callbacks_to t
      t
    else
      input_place.output_transitions.create! workflow: workflow,
                                             name: name,
                                             output_token_create_strategy: :match_one_or_fallback,
                                             auto_finish_strategy: "synchronously",
                                             generated_by_step_id: id
    end

  simple_merge_place = workflow.places.create! workflow: workflow

  deploy_branches_to(workflow, exclusive_choice_transition, simple_merge_place)

  simple_merge_place
end

#fallback_branch_required?Boolean

Returns:



43
44
45
# File 'app/models/flow_core/steps/exclusive_choice.rb', line 43

def fallback_branch_required?
  true
end

#transition_trigger_attachable?Boolean

Returns:



35
36
37
# File 'app/models/flow_core/steps/exclusive_choice.rb', line 35

def transition_trigger_attachable?
  true
end