From 8ae9179a6462f8223bfbd65e0c07eccc15eee098 Mon Sep 17 00:00:00 2001 From: jasquat Date: Thu, 10 Nov 2022 15:55:17 -0500 Subject: [PATCH] use error as a status instead of faulted w/ burnettk --- spiffworkflow-backend/src/spiffworkflow_backend/api.yml | 2 +- .../src/spiffworkflow_backend/models/process_instance.py | 2 +- .../services/acceptance_test_fixtures.py | 2 +- .../services/error_handling_service.py | 2 +- .../services/process_instance_service.py | 2 +- .../spiffworkflow_backend/integration/test_process_api.py | 4 ++-- spiffworkflow-frontend/src/config.tsx | 2 +- spiffworkflow-frontend/src/routes/ProcessInstanceShow.tsx | 6 +++--- 8 files changed, 11 insertions(+), 11 deletions(-) diff --git a/spiffworkflow-backend/src/spiffworkflow_backend/api.yml b/spiffworkflow-backend/src/spiffworkflow_backend/api.yml index 2bfa117e..cbd21576 100755 --- a/spiffworkflow-backend/src/spiffworkflow_backend/api.yml +++ b/spiffworkflow-backend/src/spiffworkflow_backend/api.yml @@ -413,7 +413,7 @@ paths: - name: process_status in: query required: false - description: For filtering - not_started, user_input_required, waiting, complete, faulted, or suspended + description: For filtering - not_started, user_input_required, waiting, complete, error, or suspended schema: type: string # process_instance_list diff --git a/spiffworkflow-backend/src/spiffworkflow_backend/models/process_instance.py b/spiffworkflow-backend/src/spiffworkflow_backend/models/process_instance.py index 64814e8f..cfa89252 100644 --- a/spiffworkflow-backend/src/spiffworkflow_backend/models/process_instance.py +++ b/spiffworkflow-backend/src/spiffworkflow_backend/models/process_instance.py @@ -61,7 +61,7 @@ class ProcessInstanceStatus(SpiffEnum): user_input_required = "user_input_required" waiting = "waiting" complete = "complete" - faulted = "faulted" + error = "error" suspended = "suspended" terminated = "terminated" diff --git a/spiffworkflow-backend/src/spiffworkflow_backend/services/acceptance_test_fixtures.py b/spiffworkflow-backend/src/spiffworkflow_backend/services/acceptance_test_fixtures.py index c6c1b578..cfea3148 100644 --- a/spiffworkflow-backend/src/spiffworkflow_backend/services/acceptance_test_fixtures.py +++ b/spiffworkflow-backend/src/spiffworkflow_backend/services/acceptance_test_fixtures.py @@ -24,7 +24,7 @@ def load_acceptance_test_fixtures() -> list[ProcessInstanceModel]: # user_input_required - 2 hours ago # waiting - 3 hourse ago # complete - 4 hours ago - # faulted - 5 hours ago + # error - 5 hours ago # suspended - 6 hours ago process_instances = [] for i in range(len(statuses)): diff --git a/spiffworkflow-backend/src/spiffworkflow_backend/services/error_handling_service.py b/spiffworkflow-backend/src/spiffworkflow_backend/services/error_handling_service.py index 3f1622a4..99e4fbe8 100644 --- a/spiffworkflow-backend/src/spiffworkflow_backend/services/error_handling_service.py +++ b/spiffworkflow-backend/src/spiffworkflow_backend/services/error_handling_service.py @@ -46,7 +46,7 @@ class ErrorHandlingService: # fault is the default self.set_instance_status( _processor.process_instance_model.id, - ProcessInstanceStatus.faulted.value, + ProcessInstanceStatus.error.value, ) if len(process_model.exception_notification_addresses) > 0: diff --git a/spiffworkflow-backend/src/spiffworkflow_backend/services/process_instance_service.py b/spiffworkflow-backend/src/spiffworkflow_backend/services/process_instance_service.py index d2f1bdaa..ca9f66aa 100644 --- a/spiffworkflow-backend/src/spiffworkflow_backend/services/process_instance_service.py +++ b/spiffworkflow-backend/src/spiffworkflow_backend/services/process_instance_service.py @@ -64,7 +64,7 @@ class ProcessInstanceService: processor.do_engine_steps(save=True) except Exception as e: db.session.rollback() # in case the above left the database with a bad transaction - process_instance.status = ProcessInstanceStatus.faulted.value + process_instance.status = ProcessInstanceStatus.error.value db.session.add(process_instance) db.session.commit() error_message = ( diff --git a/spiffworkflow-backend/tests/spiffworkflow_backend/integration/test_process_api.py b/spiffworkflow-backend/tests/spiffworkflow_backend/integration/test_process_api.py index 91355e0e..7f9500b0 100644 --- a/spiffworkflow-backend/tests/spiffworkflow_backend/integration/test_process_api.py +++ b/spiffworkflow-backend/tests/spiffworkflow_backend/integration/test_process_api.py @@ -1716,7 +1716,7 @@ class TestProcessApi(BaseTest): .first() ) assert process is not None - assert process.status == "faulted" + assert process.status == "error" def test_error_handler_suspend( self, @@ -1827,7 +1827,7 @@ class TestProcessApi(BaseTest): .first() ) assert process is not None - assert process.status == "faulted" + assert process.status == "error" def test_process_model_file_create( self, diff --git a/spiffworkflow-frontend/src/config.tsx b/spiffworkflow-frontend/src/config.tsx index 0ded81e3..47ff5025 100644 --- a/spiffworkflow-frontend/src/config.tsx +++ b/spiffworkflow-frontend/src/config.tsx @@ -12,7 +12,7 @@ export const PROCESS_STATUSES = [ 'user_input_required', 'waiting', 'complete', - 'faulted', + 'error', 'suspended', ]; diff --git a/spiffworkflow-frontend/src/routes/ProcessInstanceShow.tsx b/spiffworkflow-frontend/src/routes/ProcessInstanceShow.tsx index b9ac85eb..df6944bb 100644 --- a/spiffworkflow-frontend/src/routes/ProcessInstanceShow.tsx +++ b/spiffworkflow-frontend/src/routes/ProcessInstanceShow.tsx @@ -206,7 +206,7 @@ export default function ProcessInstanceShow() { statusIcon = ; } else if (processInstanceToUse.status === 'terminated') { statusIcon = ; - } else if (processInstanceToUse.status === 'faulted') { + } else if (processInstanceToUse.status === 'error') { statusIcon = ; } @@ -262,7 +262,7 @@ export default function ProcessInstanceShow() { const terminateButton = (processInstanceToUse: any) => { if ( - ['complete', 'terminated', 'faulted'].indexOf( + ['complete', 'terminated', 'error'].indexOf( processInstanceToUse.status ) === -1 ) { @@ -283,7 +283,7 @@ export default function ProcessInstanceShow() { const suspendButton = (processInstanceToUse: any) => { if ( - ['complete', 'terminated', 'faulted', 'suspended'].indexOf( + ['complete', 'terminated', 'error', 'suspended'].indexOf( processInstanceToUse.status ) === -1 ) {