Add durable workflow triggers and waits

This commit is contained in:
2026-08-01 20:57:26 +02:00
parent 55f98d1b65
commit a1cea1d162
12 changed files with 2213 additions and 275 deletions
+17 -6
View File
@@ -39,6 +39,9 @@ from govoplan_workflow_engine.backend.db.models import (
WorkflowInstance,
WorkflowInstanceEvent,
WorkflowInstanceStep,
WorkflowTrigger,
WorkflowTriggerDelivery,
WorkflowWaitState,
)
from govoplan_workflow_engine.backend.instance_service import (
SqlWorkflowRuntimeWorker,
@@ -64,6 +67,7 @@ from govoplan_workflow_engine.backend.service import (
create_definition,
)
from govoplan_workflow_engine.backend.service_launcher import WorkflowServiceLauncher
try:
from test_bpmn import NATIVE_BPMN
except ModuleNotFoundError as exc:
@@ -364,12 +368,13 @@ class Registry:
self.action = action
def has_capability(self, name: str) -> bool:
return name == CAPABILITY_DATAFLOW_RUN_LIFECYCLE or (
name == CAPABILITY_AUTH_AUTOMATION_PRINCIPAL_PROVIDER
and self.automation is not None
) or (
name == "test.actions"
and self.action is not None
return (
name == CAPABILITY_DATAFLOW_RUN_LIFECYCLE
or (
name == CAPABILITY_AUTH_AUTOMATION_PRINCIPAL_PROVIDER
and self.automation is not None
)
or (name == "test.actions" and self.action is not None)
)
def capability(self, name: str):
@@ -396,6 +401,9 @@ class WorkflowInstanceServiceTests(unittest.TestCase):
WorkflowInstance.__table__,
WorkflowInstanceStep.__table__,
WorkflowInstanceEvent.__table__,
WorkflowTrigger.__table__,
WorkflowTriggerDelivery.__table__,
WorkflowWaitState.__table__,
],
)
self.Session = sessionmaker(bind=self.engine)
@@ -428,6 +436,9 @@ class WorkflowInstanceServiceTests(unittest.TestCase):
Base.metadata.drop_all(
self.engine,
tables=[
WorkflowWaitState.__table__,
WorkflowTriggerDelivery.__table__,
WorkflowTrigger.__table__,
WorkflowInstanceEvent.__table__,
WorkflowInstanceStep.__table__,
WorkflowInstance.__table__,