This commit is contained in:
jokob-sk
2025-03-30 10:25:03 +11:00
parent 5d01af1758
commit 3f74173245
26 changed files with 470 additions and 120 deletions

View File

@@ -55,14 +55,17 @@ class WorkflowManager:
# Check if the trigger conditions match
for workflow in self.workflows:
# construct trigger object which also evaluates if the current event triggers it
trigger = Trigger(workflow["trigger"], event, self.db)
# Ensure workflow is enabled before proceeding
if workflow.get("enabled", "No").lower() == "yes":
# construct trigger object which also evaluates if the current event triggers it
trigger = Trigger(workflow["trigger"], event, self.db)
if trigger.triggered:
if trigger.triggered:
mylog('verbose', [f"[WF] Event with GUID '{event["GUID"]}' triggered the workflow '{workflow["name"]}'"])
mylog('verbose', [f"[WF] Event with GUID '{event["GUID"]}' triggered the workflow '{workflow["name"]}'"])
self.execute_workflow(workflow, trigger)
self.execute_workflow(workflow, trigger)
# After processing the event, mark the event as processed (set AppEventProcessed to 1)
self.db.sql.execute("""