diff --git a/spiffworkflow-backend/src/spiffworkflow_backend/models/process_instance.py b/spiffworkflow-backend/src/spiffworkflow_backend/models/process_instance.py index 0e4112d6..50c3c9f7 100644 --- a/spiffworkflow-backend/src/spiffworkflow_backend/models/process_instance.py +++ b/spiffworkflow-backend/src/spiffworkflow_backend/models/process_instance.py @@ -112,6 +112,7 @@ class ProcessInstanceModel(SpiffworkflowBaseDBModel): "end_in_seconds": self.end_in_seconds, "process_initiator_id": self.process_initiator_id, "bpmn_xml_file_contents": local_bpmn_xml_file_contents, + "spiff_step": self.spiff_step, } @property diff --git a/spiffworkflow-frontend/src/routes/ProcessInstanceShow.tsx b/spiffworkflow-frontend/src/routes/ProcessInstanceShow.tsx index 677e5b09..642c7d65 100644 --- a/spiffworkflow-frontend/src/routes/ProcessInstanceShow.tsx +++ b/spiffworkflow-frontend/src/routes/ProcessInstanceShow.tsx @@ -96,6 +96,62 @@ export default function ProcessInstanceShow() { return taskIds; }; + const currentSpiffStep = (processInstanceToUse: any) => { + if (typeof params.spiff_step === 'undefined') { + return processInstanceToUse.spiff_step; + } + + return Number(params.spiff_step); + }; + + const showingFirstSpiffStep = (processInstanceToUse: any) => { + return currentSpiffStep(processInstanceToUse) === 1; + }; + + const showingLastSpiffStep = (processInstanceToUse: any) => { + return ( + currentSpiffStep(processInstanceToUse) === processInstanceToUse.spiff_step + ); + }; + + const spiffStepLink = ( + processInstanceToUse: any, + label: string, + distance: number + ) => { + return ( +