55 lines
2.0 KiB
Python
55 lines
2.0 KiB
Python
#!/usr/bin/env python3
|
|
"""
|
|
Main script to set up the example workflows shown by the user
|
|
This creates both the Auto Settlement Letter and Deadline Reminder workflows
|
|
"""
|
|
import asyncio
|
|
import sys
|
|
import os
|
|
|
|
# Add the project root to Python path
|
|
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
|
|
|
|
from create_settlement_workflow import create_settlement_workflow
|
|
from create_deadline_reminder_workflow import create_deadline_reminder_workflow
|
|
|
|
|
|
def main():
|
|
"""Set up all example workflows"""
|
|
print("🚀 Setting up Example Workflows for Delphi Database")
|
|
print("=" * 60)
|
|
|
|
print("\n1. Creating Auto Settlement Letter Workflow...")
|
|
try:
|
|
settlement_workflow = create_settlement_workflow()
|
|
print("✅ Auto Settlement Letter workflow created successfully!")
|
|
except Exception as e:
|
|
print(f"❌ Failed to create Auto Settlement Letter workflow: {str(e)}")
|
|
return False
|
|
|
|
print("\n2. Creating Deadline Reminder Workflow...")
|
|
try:
|
|
deadline_workflow = create_deadline_reminder_workflow()
|
|
print("✅ Deadline Reminder workflow created successfully!")
|
|
except Exception as e:
|
|
print(f"❌ Failed to create Deadline Reminder workflow: {str(e)}")
|
|
return False
|
|
|
|
print("\n" + "=" * 60)
|
|
print("🎉 All example workflows have been created successfully!")
|
|
print("\nWorkflow Summary:")
|
|
print("- Auto Settlement Letter: Generates PDF when file status changes to CLOSED")
|
|
print("- Deadline Reminder: Sends email when deadlines are ≤ 7 days away")
|
|
print("\nThese workflows will automatically trigger based on system events.")
|
|
print("\nNext steps:")
|
|
print("1. Test the workflows by changing a file status to CLOSED")
|
|
print("2. Set up deadline monitoring for automatic deadline approaching events")
|
|
print("3. Configure email settings for deadline reminders")
|
|
|
|
return True
|
|
|
|
|
|
if __name__ == "__main__":
|
|
success = main()
|
|
sys.exit(0 if success else 1)
|