Skip to main content

bpm_engine_storage/
process_store.rs

1use async_trait::async_trait;
2use bpm_engine_core::{ProcessDefinition, ProcessInstance};
3
4#[async_trait]
5pub trait ProcessInstanceStore: Send + Sync {
6    async fn load(&self, id: &str) -> anyhow::Result<Option<ProcessInstance>>;
7    async fn save(&self, instance: &ProcessInstance) -> anyhow::Result<()>;
8    async fn list_running(&self, tenant_id: Option<&str>) -> anyhow::Result<Vec<String>>;
9}
10
11#[async_trait]
12pub trait ProcessDefinitionStore: Send + Sync {
13    async fn load(&self, id: &str) -> anyhow::Result<Option<ProcessDefinition>>;
14}