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
25
|
# File 'lib/autoload/kuroko2/workflow/task/fork.rb', line 5
def execute
children = token.children
if children.empty?
message = "(token #{token.uuid}) Start to fork."
token.job_instance.logs.info(message)
Kuroko2.logger.info(message)
:pass
elsif children.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
27
28
29
30
31
|
# File 'lib/autoload/kuroko2/workflow/task/fork.rb', line 27
def validate
if node.children.empty?
raise Workflow::AssertionError, "#{self.class} must have children node"
end
end
|