Class: Bizflow::BusinessModel::TaskAction
- Inherits:
-
SimpleWrapper
- Object
- SimpleDelegator
- SimpleWrapper
- Bizflow::BusinessModel::TaskAction
- Defined in:
- lib/bizflow/business_model/task_action.rb
Instance Method Summary collapse
Methods inherited from SimpleWrapper
Instance Method Details
#active ⇒ Object
25 26 27 |
# File 'lib/bizflow/business_model/task_action.rb', line 25 def active tasks_dataset.where(finished_at: nil).all end |
#finish ⇒ Object
14 15 16 17 18 19 |
# File 'lib/bizflow/business_model/task_action.rb', line 14 def finish bhs = Bizflow::BusinessModel::Head.wraps(heads) bp = Bizflow::BusinessModel::Process.wrap(process) next_action_id = next_action ? next_action.id : nil bhs.each { |h| h.jump(next_action_id) } end |
#next_action ⇒ Object
21 22 23 |
# File 'lib/bizflow/business_model/task_action.rb', line 21 def next_action nexts.first end |
#resolve ⇒ Object
8 9 10 11 12 |
# File 'lib/bizflow/business_model/task_action.rb', line 8 def resolve action_blueprint.task_blueprints.each do |tbp| add_task(name: tbp.name, task_blueprint: tbp) end end |
#task_finished ⇒ Object
29 30 31 |
# File 'lib/bizflow/business_model/task_action.rb', line 29 def task_finished finish if active.empty? end |