pub struct ExecutionManager { /* private fields */ }Expand description
Central coordinator for execution plan execution
Manages execution lifecycle (start, pause, resume, cancel) and tracks active executions. Wraps the WorkflowEngine and provides high-level execution plan management.
Implementations§
Source§impl ExecutionManager
impl ExecutionManager
Sourcepub fn register_plan(&mut self, plan: ExecutionPlan) -> ExecutionResult<String>
pub fn register_plan(&mut self, plan: ExecutionPlan) -> ExecutionResult<String>
Register an execution plan
Stores the plan for later execution. Returns the plan ID.
Sourcepub fn get_plan(&self, plan_id: &str) -> ExecutionResult<ExecutionPlan>
pub fn get_plan(&self, plan_id: &str) -> ExecutionResult<ExecutionPlan>
Get a registered plan
Sourcepub fn start_execution(
&mut self,
plan_id: &str,
mode: ExecutionMode,
) -> ExecutionResult<String>
pub fn start_execution( &mut self, plan_id: &str, mode: ExecutionMode, ) -> ExecutionResult<String>
Start execution of a plan
Creates a new execution state and begins execution in the specified mode. Also creates a progress tracker for the execution.
Sourcepub fn pause_execution(&mut self, execution_id: &str) -> ExecutionResult<()>
pub fn pause_execution(&mut self, execution_id: &str) -> ExecutionResult<()>
Pause an active execution
Saves the current execution state for later resumption.
Sourcepub fn resume_execution(&mut self, execution_id: &str) -> ExecutionResult<()>
pub fn resume_execution(&mut self, execution_id: &str) -> ExecutionResult<()>
Resume a paused execution
Continues execution from where it was paused.
Sourcepub fn cancel_execution(&mut self, execution_id: &str) -> ExecutionResult<()>
pub fn cancel_execution(&mut self, execution_id: &str) -> ExecutionResult<()>
Cancel an active execution
Stops execution and removes the execution state and progress tracker.
Sourcepub fn get_execution_state(
&self,
execution_id: &str,
) -> ExecutionResult<ExecutionState>
pub fn get_execution_state( &self, execution_id: &str, ) -> ExecutionResult<ExecutionState>
Get the current state of an execution
Sourcepub fn get_active_executions(&self) -> Vec<ExecutionState>
pub fn get_active_executions(&self) -> Vec<ExecutionState>
Get all active executions
Sourcepub fn get_progress_tracker_mut(
&mut self,
execution_id: &str,
) -> ExecutionResult<&mut ProgressTracker>
pub fn get_progress_tracker_mut( &mut self, execution_id: &str, ) -> ExecutionResult<&mut ProgressTracker>
Get the progress tracker for an execution
Returns a mutable reference to the progress tracker for the given execution.
Sourcepub fn get_progress_tracker(
&self,
execution_id: &str,
) -> ExecutionResult<&ProgressTracker>
pub fn get_progress_tracker( &self, execution_id: &str, ) -> ExecutionResult<&ProgressTracker>
Get the progress tracker for an execution (read-only)
Returns a reference to the progress tracker for the given execution.
Sourcepub fn on_progress<F>(
&mut self,
execution_id: &str,
callback: F,
) -> ExecutionResult<()>
pub fn on_progress<F>( &mut self, execution_id: &str, callback: F, ) -> ExecutionResult<()>
Register a progress callback for an execution
Callbacks are called whenever progress is updated during execution.