Class: Kuroko2::Workflow::Task::Fork
- Inherits:
-
Base
- Object
- Base
- Kuroko2::Workflow::Task::Fork
show all
- Defined in:
- lib/autoload/kuroko2/workflow/task/fork.rb
Instance Method Summary
collapse
Methods inherited from Base
#initialize
Instance Method Details
#execute ⇒ Object
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
# File 'lib/autoload/kuroko2/workflow/task/fork.rb', line 5
def execute
if fork_children_ids.empty?
message = "(token #{token.uuid}) Start to fork."
token.job_instance.logs.info(message)
Kuroko2.logger.info(message)
:pass
elsif token.children.where(id: fork_children_ids).all?(&:finished?)
message = "(token #{token.uuid}) All children are finished."
token.job_instance.logs.info(message)
Kuroko2.logger.info(message)
:next_sibling
else
:pass
end
end
|
#validate ⇒ Object
26
27
28
29
30
|
# File 'lib/autoload/kuroko2/workflow/task/fork.rb', line 26
def validate
if node.children.empty?
raise Workflow::AssertionError, "#{self.class} must have children node"
end
end
|