Class: RailsWorkflow::ProcessTemplate
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- RailsWorkflow::ProcessTemplate
- Defined in:
- app/models/rails_workflow/process_template.rb
Instance Method Summary collapse
-
#dependent_operations(operation) ⇒ Object
here we calculate template operations that depends on given process operation status and template id.
- #independent_operations ⇒ Object
- #manager_class ⇒ Object
- #other_processes ⇒ Object
-
#process_class ⇒ Object
we try to read process class from template and set default Workflow::Process if blank process_class on template.
Methods included from Uuid
Methods included from RailsWorkflow::ProcessTemplates::DefaultBuilder
#build_independent_operations, #build_operation, #build_process!
Instance Method Details
#dependent_operations(operation) ⇒ Object
here we calculate template operations that depends on given process operation status and template id
29 30 31 32 33 34 35 |
# File 'app/models/rails_workflow/process_template.rb', line 29 def dependent_operations(operation) operations.select do |top| top.dependencies.select do |dp| dp['id'] == operation.template.id && dp['statuses'].include?(operation.status) end.present? end end |
#independent_operations ⇒ Object
23 24 25 |
# File 'app/models/rails_workflow/process_template.rb', line 23 def independent_operations operations.select(&:independent?) end |
#manager_class ⇒ Object
19 20 21 |
# File 'app/models/rails_workflow/process_template.rb', line 19 def manager_class get_class_for :manager_class, RailsWorkflow.config.manager_class end |
#other_processes ⇒ Object
9 10 11 |
# File 'app/models/rails_workflow/process_template.rb', line 9 def other_processes ProcessTemplate.where.not(id: id) end |
#process_class ⇒ Object
we try to read process class from template and set default Workflow::Process if blank process_class on template
15 16 17 |
# File 'app/models/rails_workflow/process_template.rb', line 15 def process_class get_class_for :process_class, RailsWorkflow.config.process_class end |