BeaPro Framework¶
BeaPro (BotCity Enterprise Automation Process) is a production-ready automation framework built on top of BotCity. It provides state management, structured error handling, and integration with the BotCity Orchestrator.
The project comes with the whole execution structure ready and the Orchestrator integration already handled, so you can focus only on your automation logic.
Features¶
- State Management: counts items processed successfully and with errors, and computes the final task status automatically.
- Structured Exception Handling: automatic handling of business exceptions, system exceptions, and interruption requests.
- Standardized Logs: a file log with timestamps and an Orchestrator log with the summary of each execution.
- Multiple Data Sources: support for CSV files and Orchestrator Datapools, as well as custom sources.
- Error Reporting: screenshot capture, alerts, and error records in the Orchestrator.
- Controlled Shutdown: closes the browser, uploads result files, and finishes the task with the correct status.
- Automatic Recovery: after a system exception, the environment is reinitialized and processing continues with the next item.
- Flexible Structure: all framework modules live in the
framework/folder, leaving the rest of the project free for your own files and modules.
Project Structure¶
BeaPro/
├── bot.py # Main automation orchestration
├── framework/ # Core framework modules
│ ├── state.py # State management and BotCity SDK setup
│ ├── exceptions.py # Custom exception classes
│ ├── datasources.py # Data source implementations (CSV, Datapool)
│ ├── process.py # Main automation logic (ADD YOUR CODE HERE)
│ ├── initialize.py # Initialization and setup
│ ├── finalize.py # Cleanup and finalization
│ ├── status_handling.py # Exception and success handlers
│ └── logger.py # Logging configuration
├── requirements.txt # Python dependencies
├── .env # Environment variables for testing (credentials)
├── .gitignore # Files ignored by Git
├── resources/ # Automation support files (e.g. input CSV)
├── output/ # Generated output files and logs
├── temp/ # Temporary files (screenshots, etc.)
└── build/ # Build scripts
Details for each module
See the role of each file and how to customize it in Framework Components.
Exception Handling Flow¶
For each data source item, bot.py runs process_item(item) and decides the next step based on the result:
For each item:
├─ Try: process_item(item)
│ ├─ Success → register_success()
│ └─ Exception:
│ ├─ InterruptException → handle_interrupt_requested() → STOP
│ ├─ BusinessException → handle_business_exception() → CONTINUE
│ └─ SystemException → handle_system_exception() → RESTART → CONTINUE
└─ Next item
At the end (or after an interruption): cleanup() → finalize()
Unexpected exceptions
Any exception other than BusinessException or InterruptException is handled as a system exception, including unexpected Python errors. You do not need to raise SystemException explicitly to trigger the restart.