2022-09-16 21:04:45 +00:00
|
|
|
"""Grabs tickets from csv and makes process instances."""
|
2022-10-12 18:19:51 +00:00
|
|
|
import os
|
2022-10-12 18:40:25 +00:00
|
|
|
|
2022-12-08 21:39:23 +00:00
|
|
|
from spiffworkflow_backend import create_app
|
2022-10-12 17:09:13 +00:00
|
|
|
from spiffworkflow_backend.services.data_setup_service import DataSetupService
|
2022-09-16 21:04:45 +00:00
|
|
|
|
2022-09-16 22:41:39 +00:00
|
|
|
|
2022-10-12 17:09:13 +00:00
|
|
|
def main() -> None:
|
2022-09-16 21:04:45 +00:00
|
|
|
"""Main."""
|
2022-12-08 21:39:23 +00:00
|
|
|
app = create_app()
|
2022-09-16 21:04:45 +00:00
|
|
|
with app.app_context():
|
2022-10-12 17:26:04 +00:00
|
|
|
failing_process_models = DataSetupService.save_all_process_models()
|
2022-09-28 19:33:12 +00:00
|
|
|
for bpmn_errors in failing_process_models:
|
|
|
|
print(bpmn_errors)
|
2022-10-12 18:40:25 +00:00
|
|
|
if (
|
|
|
|
os.environ.get("SPIFFWORKFLOW_BACKEND_FAIL_ON_INVALID_PROCESS_MODELS")
|
|
|
|
!= "false"
|
|
|
|
and len(failing_process_models) > 0
|
|
|
|
):
|
2022-09-28 19:33:12 +00:00
|
|
|
exit(1)
|
2022-09-16 21:04:45 +00:00
|
|
|
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
main()
|