Class: Pallets::Workflow
- Inherits:
-
Object
- Object
- Pallets::Workflow
- Extended by:
- DSL::Workflow
- Defined in:
- lib/pallets/workflow.rb
Instance Attribute Summary collapse
-
#context ⇒ Object
readonly
Returns the value of attribute context.
Instance Method Summary collapse
- #id ⇒ Object
-
#initialize(context_hash = {}) ⇒ Workflow
constructor
A new instance of Workflow.
- #run ⇒ Object
Methods included from DSL::Workflow
Constructor Details
Instance Attribute Details
#context ⇒ Object (readonly)
Returns the value of attribute context.
5 6 7 |
# File 'lib/pallets/workflow.rb', line 5 def context @context end |
Instance Method Details
#id ⇒ Object
21 22 23 |
# File 'lib/pallets/workflow.rb', line 21 def id @id ||= "P#{Pallets::Util.generate_id(self.class.name)}".upcase end |
#run ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/pallets/workflow.rb', line 13 def run raise WorkflowError, "#{self.class.name} has no tasks. Workflows "\ "must contain at least one task" if self.class.graph.empty? backend.run_workflow(id, jobs_with_order, serializer.dump_context(context.buffer)) id end |