Module: CMDx::Workflow

Defined in:
lib/cmdx/workflow.rb

Overview

Provides workflow execution capabilities by organizing tasks into execution groups. Workflows allow you to define sequences of tasks that can be executed conditionally with breakpoint handling and context management.

Defined Under Namespace

Modules: ClassMethods Classes: ExecutionGroup

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object

Extends the including class with workflow capabilities.

Examples:

class MyWorkflow
  include CMDx::Workflow
  # Now has access to task, tasks, and work methods
end

Parameters:

  • base (Class)

    The class including this module



94
95
96
# File 'lib/cmdx/workflow.rb', line 94

def self.included(base)
  base.extend(ClassMethods)
end

Instance Method Details

#workObject

Executes the workflow by processing all tasks in the pipeline. This method delegates execution to the Pipeline class which handles the processing of tasks with proper error handling and context management.

Examples:

class MyWorkflow
  include CMDx::Workflow
  task ValidateTask
  task ProcessTask
end

workflow = MyWorkflow.new
result = workflow.work


113
114
115
# File 'lib/cmdx/workflow.rb', line 113

def work
  Pipeline.execute(self)
end