Skip to main content

Activity

Trait Activity 

Source
pub trait Activity: Send + Sync {
    // Required methods
    fn execute<'life0, 'life1, 'async_trait>(
        &'life0 self,
        context: &'life1 mut ExecutionContext,
    ) -> Pin<Box<dyn Future<Output = Result<ActivityResult, ActivityError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn id(&self) -> &str;
    fn name(&self) -> Option<&str>;
}
Expand description

Activity Trait

Represents an executable activity in a BPMN process. Activities can be tasks, gateways, events, or other executable elements.

Required Methods§

Source

fn execute<'life0, 'life1, 'async_trait>( &'life0 self, context: &'life1 mut ExecutionContext, ) -> Pin<Box<dyn Future<Output = Result<ActivityResult, ActivityError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Execute the activity

§Arguments
  • context - Execution context containing process state, variables, etc.
§Returns
  • Ok(ActivityResult) - Activity execution result
  • Err(ActivityError) - Activity execution error
Source

fn id(&self) -> &str

Get the activity ID

Source

fn name(&self) -> Option<&str>

Get the activity name

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§