bpm-engine 0.1.0

Lightweight embeddable BPM runtime for long-running, stateful workflows with tokens, timers, Saga compensation, and crash recovery
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//! NodeExecutor: execute node for token, advance token (design: overview §3.2).

use crate::model::{Node, ProcessInstance, Token};

/// Execution context passed to executor (variables, services, etc.).
pub struct ExecutionContext<'a> {
    pub instance: &'a mut ProcessInstance,
}

/// Design: overview §3.2 — execute(node, token, ctx).
pub trait NodeExecutor {
    fn execute(
        &self,
        node: &Node,
        token: &mut Token,
        ctx: &mut ExecutionContext<'_>,
    );
}