bpm-engine-storage 0.2.0

Storage traits and types for the BPM engine (process, token, timer, history)
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use async_trait::async_trait;
use bpm_engine_core::{ProcessDefinition, ProcessInstance};

#[async_trait]
pub trait ProcessInstanceStore: Send + Sync {
    async fn load(&self, id: &str) -> anyhow::Result<Option<ProcessInstance>>;
    async fn save(&self, instance: &ProcessInstance) -> anyhow::Result<()>;
    async fn list_running(&self, tenant_id: Option<&str>) -> anyhow::Result<Vec<String>>;
}

#[async_trait]
pub trait ProcessDefinitionStore: Send + Sync {
    async fn load(&self, id: &str) -> anyhow::Result<Option<ProcessDefinition>>;
}