OpenOrchestrator robot that, once per day, emails a summary of all inspections registered through the TilsynsApp that day.
- Queries the
TilsynItemscontainer in Cosmos for documents withlast_inspected_atmatching today's date. - Flattens each document's
inspectionshistory into one row per real inspection performed today (hide/restore entries are filtered out). - Builds an HTML table with a direct link to each case's origin system:
- Permission →
https://vejman.vd.dk/permissions/update.jsp?caseid={case_id} - Henstilling →
https://pez.giantleap.net/cases/view/{PEZUUID}/case - Indmeldt →
https://vejmankassen.adm.aarhuskommune.dk/tilsyn
- Permission →
- Sends the table to the recipient stored in the
VejArealMailOpenOrchestrator constant. Subject: "Dagens inspektioner".
If no inspections were registered today, no mail is sent and the robot exits quietly.
| Column | Source |
|---|---|
| Tid | inspected_at from the inspection record (formatted HH:MM) |
| Tilsynsførende | Initial portion of inspector_email |
| Sagsnummer | case_number (or HenstillingId for henstillinger), linked |
| Adresse | full_address |
| Information | rovm_equipment_type / Forseelse / title depending on type |
| Status | selection (permission), mapped faktura_status (henstilling), or "Tilset" (indmeldt). For henstillinger, any kvadratmeter / end_date change is shown as a sub-line. |
| Kommentar | Free-text comment from the inspector |
VejArealMail— recipient address for the daily mail.
AAKTilsynDB— Cosmos DB:username= endpoint URL,password= key.
Schedule as a single daily trigger (e.g. 16:00) — uses the linear flow.
dependencies = [
"OpenOrchestrator == 2.*",
"azure-cosmos == 4.15.0",
]SMTP host/port are read from robot_framework/config.py (SMTP_SERVER, SMTP_PORT) — same pattern as the existing RegelRytteren robot.
This repo is meant to be used as a template for robots made for OpenOrchestrator v2.
-
To use this template simply use this repo as a template (see Creating a repository from a template). Don't include all branches.
-
Go to
robot_framework/__main__.pyand choose between the linear framework or queue based framework. -
Implement all functions in the files:
robot_framework/initialize.pyrobot_framework/reset.pyrobot_framework/process.py
-
Change
config.pyto your needs. -
Fill out the dependencies in the
pyproject.tomlfile with all packages needed by the robot. -
Feel free to add more files as needed. Remember that any additional python files must be located in the folder
robot_frameworkor a subfolder of it.
When the robot is run from OpenOrchestrator the main.py file is run which results
in the following:
- The working directory is changed to where
main.pyis located. - A virtual environment is automatically setup with the required packages.
- The framework is called passing on all arguments needed by OpenOrchestrator.
Minimum python version 3.11
This framework contains two different flows: A linear and a queue based.
You should only ever use one at a time. You choose which one by going into robot_framework/__main__.py
and uncommenting the framework you want. They are both disabled by default and an error will be
raised to remind you if you don't choose.
The linear framework is used when a robot is just going from A to Z without fetching jobs from an OpenOrchestrator queue. The flow of the linear framework is sketched up in the following illustration:
The queue framework is used when the robot is doing multiple bite-sized tasks defined in an OpenOrchestrator queue. The flow of the queue framework is sketched up in the following illustration:
This template is also setup with flake8 and pylint linting in Github Actions.
This workflow will trigger whenever you push your code to Github.
The workflow is defined under .github/workflows/Linting.yml.