WorkflowEngine

Struct WorkflowEngine 

Source
pub struct WorkflowEngine { /* private fields */ }
Expand description

Manages workflow execution and scheduling

Implementations§

Source§

impl WorkflowEngine

Source

pub fn new() -> Self

Create a new workflow engine

Source

pub fn start_workflow(&mut self, workflow_name: Option<String>) -> String

Start a new workflow

Source

pub fn activate_agenda_group(&mut self, group: String)

Activate an agenda group for workflow progression

Source

pub fn schedule_rule( &mut self, rule_name: String, delay_ms: u64, workflow_id: Option<String>, )

Schedule a rule to execute after a delay

Source

pub fn complete_workflow(&mut self, workflow_name: String)

Complete a workflow

Source

pub fn set_workflow_data( &mut self, workflow_id: &str, key: String, value: Value, )

Set workflow data

Source

pub fn get_next_agenda_group(&mut self) -> Option<String>

Get the next agenda group to activate

Source

pub fn get_ready_tasks(&mut self) -> Vec<ScheduledTask>

Get ready scheduled tasks

Source

pub fn get_next_pending_agenda_activation(&mut self) -> Option<String>

Get the next pending agenda activation (for syncing with agenda manager)

Source

pub fn get_workflow(&self, workflow_id: &str) -> Option<&WorkflowState>

Get workflow state by ID

Source

pub fn get_active_workflows(&self) -> Vec<&WorkflowState>

Get all active workflows

Source

pub fn get_workflow_stats(&self) -> WorkflowStats

Get workflow statistics

Source

pub fn cleanup_completed_workflows(&mut self, older_than: Duration)

Clean up completed workflows older than specified duration

Trait Implementations§

Source§

impl Debug for WorkflowEngine

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for WorkflowEngine

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.