Class: FlowCore::Step
- Inherits:
-
ApplicationRecord
show all
- Extended by:
- ActiveRecord::Acts::List::ClassMethods, Ancestry::HasAncestry
- Defined in:
- app/models/flow_core/step.rb
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
Instance Attribute Details
#append_to ⇒ Object
Returns the value of attribute append_to.
65
66
67
|
# File 'app/models/flow_core/step.rb', line 65
def append_to
@append_to
end
|
Class Method Details
.barrier_step? ⇒ Boolean
192
193
194
|
# File 'app/models/flow_core/step.rb', line 192
def barrier_step?
false
end
|
.branch_arc_guard_attachable? ⇒ Boolean
204
205
206
|
# File 'app/models/flow_core/step.rb', line 204
def branch_arc_guard_attachable?
false
end
|
.branch_configurable? ⇒ Boolean
212
213
214
|
# File 'app/models/flow_core/step.rb', line 212
def branch_configurable?
false
end
|
.fallback_branch_required? ⇒ Boolean
220
221
222
|
# File 'app/models/flow_core/step.rb', line 220
def fallback_branch_required?
false
end
|
.multi_branch_step? ⇒ Boolean
184
185
186
|
# File 'app/models/flow_core/step.rb', line 184
def multi_branch_step?
false
end
|
.redirection_configurable? ⇒ Boolean
208
209
210
|
# File 'app/models/flow_core/step.rb', line 208
def redirection_configurable?
false
end
|
.redirection_step? ⇒ Boolean
188
189
190
|
# File 'app/models/flow_core/step.rb', line 188
def redirection_step?
false
end
|
.transition_callback_attachable? ⇒ Boolean
200
201
202
|
# File 'app/models/flow_core/step.rb', line 200
def transition_callback_attachable?
!multi_branch_step?
end
|
.transition_trigger_attachable? ⇒ Boolean
196
197
198
|
# File 'app/models/flow_core/step.rb', line 196
def transition_trigger_attachable?
!multi_branch_step? && !redirection_step?
end
|
.transition_trigger_required? ⇒ Boolean
216
217
218
|
# File 'app/models/flow_core/step.rb', line 216
def transition_trigger_required?
false
end
|
Instance Method Details
#barrier_step? ⇒ Boolean
79
80
81
|
# File 'app/models/flow_core/step.rb', line 79
def barrier_step?
self.class.barrier_step?
end
|
#branch_arc_guard_attachable? ⇒ Boolean
91
92
93
|
# File 'app/models/flow_core/step.rb', line 91
def branch_arc_guard_attachable?
self.class.branch_arc_guard_attachable?
end
|
#branch_configurable? ⇒ Boolean
107
108
109
|
# File 'app/models/flow_core/step.rb', line 107
def branch_configurable?
self.class.branch_configurable?
end
|
#deploy_to_workflow!(_workflow, _input_place_or_transition) ⇒ Object
67
68
69
|
# File 'app/models/flow_core/step.rb', line 67
def deploy_to_workflow!(_workflow, _input_place_or_transition)
raise NotImplementedError
end
|
#fallback_branch_required? ⇒ Boolean
95
96
97
|
# File 'app/models/flow_core/step.rb', line 95
def fallback_branch_required?
self.class.fallback_branch_required?
end
|
#multi_branch_step? ⇒ Boolean
75
76
77
|
# File 'app/models/flow_core/step.rb', line 75
def multi_branch_step?
self.class.multi_branch_step?
end
|
#redirectable_steps ⇒ Object
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
|
# File 'app/models/flow_core/step.rb', line 111
def redirectable_steps
return [] unless redirection_step?
redirectable_steps = []
ancestors.reverse_each do |step|
break if step.barrier_step?
redirectable_steps << step
end
return [] if redirectable_steps.empty?
if position == 1 && redirectable_steps.any?
if redirectable_steps.first.multi_branch_step? && !redirectable_steps.first.transition_trigger
redirectable_steps.shift
end
while redirectable_steps.any?
step = redirectable_steps.first
if step.multi_branch_step? && !redirectable_steps.first.transition_trigger
redirectable_steps.shift
if step.position > 1
break
end
else
break
end
end
end
if redirectable_steps.reject!(&:root?)
redirectable_steps.concat(pipeline.steps)
elsif redirectable_steps.empty?
redirectable_steps.concat(pipeline.steps - ancestors)
end
redirectable_steps.map! do |s|
if s.parent_of? self
[s].concat s.children.where.not(branch_id: branch_id)
else
[s].concat s.children
end
end
redirectable_steps.flatten!
redirectable_steps.uniq!
redirectable_steps.reject!(&:redirection_step?)
redirectable_steps
end
|
#redirection_configurable? ⇒ Boolean
103
104
105
|
# File 'app/models/flow_core/step.rb', line 103
def redirection_configurable?
self.class.redirection_configurable?
end
|
#redirection_step? ⇒ Boolean
71
72
73
|
# File 'app/models/flow_core/step.rb', line 71
def redirection_step?
self.class.redirection_step?
end
|
#transition_callback_attachable? ⇒ Boolean
87
88
89
|
# File 'app/models/flow_core/step.rb', line 87
def transition_callback_attachable?
self.class.transition_callback_attachable?
end
|
#transition_trigger_attachable? ⇒ Boolean
83
84
85
|
# File 'app/models/flow_core/step.rb', line 83
def transition_trigger_attachable?
self.class.transition_trigger_attachable?
end
|
#transition_trigger_required? ⇒ Boolean
99
100
101
|
# File 'app/models/flow_core/step.rb', line 99
def transition_trigger_required?
self.class.transition_trigger_required?
end
|