diff --git a/spiffworkflow-backend/src/spiffworkflow_backend/api.yml b/spiffworkflow-backend/src/spiffworkflow_backend/api.yml index 43d32c5e..1a21e643 100755 --- a/spiffworkflow-backend/src/spiffworkflow_backend/api.yml +++ b/spiffworkflow-backend/src/spiffworkflow_backend/api.yml @@ -907,12 +907,6 @@ paths: description: If true, this wil return all tasks associated with the process instance and not just user tasks. schema: type: boolean - - name: spiff_step - in: query - required: false - description: If set will return the tasks as they were during a specific step of execution. - schema: - type: integer - name: most_recent_tasks_only in: query required: false @@ -925,6 +919,12 @@ paths: description: The guid of the bpmn process to get the tasks for. schema: type: string + - name: to_task_guid + in: query + required: false + description: Get the tasks only up to the given guid. + schema: + type: string get: tags: - Process Instances @@ -966,12 +966,6 @@ paths: description: If true, this wil return all tasks associated with the process instance and not just user tasks. schema: type: boolean - - name: spiff_step - in: query - required: false - description: If set will return the tasks as they were during a specific step of execution. - schema: - type: integer - name: most_recent_tasks_only in: query required: false @@ -984,6 +978,12 @@ paths: description: The guid of the bpmn process to get the tasks for. schema: type: string + - name: to_task_guid + in: query + required: false + description: Get the tasks only up to the given guid. + schema: + type: string get: tags: - Process Instances diff --git a/spiffworkflow-backend/src/spiffworkflow_backend/routes/process_instances_controller.py b/spiffworkflow-backend/src/spiffworkflow_backend/routes/process_instances_controller.py index f75df6c1..ccc46358 100644 --- a/spiffworkflow-backend/src/spiffworkflow_backend/routes/process_instances_controller.py +++ b/spiffworkflow-backend/src/spiffworkflow_backend/routes/process_instances_controller.py @@ -563,6 +563,7 @@ def process_instance_task_list_without_task_data_for_me( spiff_step: int = 0, most_recent_tasks_only: bool = False, bpmn_process_guid: Optional[str] = None, + to_task_guid: Optional[str] = None, ) -> flask.wrappers.Response: """Process_instance_task_list_without_task_data_for_me.""" process_instance = _find_process_instance_for_me_or_raise(process_instance_id) @@ -572,7 +573,8 @@ def process_instance_task_list_without_task_data_for_me( all_tasks=all_tasks, spiff_step=spiff_step, most_recent_tasks_only=most_recent_tasks_only, - bpmn_process_guid=bpmn_process_guid + bpmn_process_guid=bpmn_process_guid, + to_task_guid=to_task_guid, ) @@ -583,6 +585,7 @@ def process_instance_task_list_without_task_data( spiff_step: int = 0, most_recent_tasks_only: bool = False, bpmn_process_guid: Optional[str] = None, + to_task_guid: Optional[str] = None, ) -> flask.wrappers.Response: """Process_instance_task_list_without_task_data.""" process_instance = _find_process_instance_by_id_or_raise(process_instance_id) @@ -592,7 +595,8 @@ def process_instance_task_list_without_task_data( all_tasks=all_tasks, spiff_step=spiff_step, most_recent_tasks_only=most_recent_tasks_only, - bpmn_process_guid=bpmn_process_guid + bpmn_process_guid=bpmn_process_guid, + to_task_guid=to_task_guid, ) diff --git a/spiffworkflow-frontend/src/routes/AdminRoutes.tsx b/spiffworkflow-frontend/src/routes/AdminRoutes.tsx index d183dc01..d04d50b1 100644 --- a/spiffworkflow-frontend/src/routes/AdminRoutes.tsx +++ b/spiffworkflow-frontend/src/routes/AdminRoutes.tsx @@ -73,7 +73,7 @@ export default function AdminRoutes() { element={} /> } /> } /> } /> { - if (processInstance && typeof params.spiff_step === 'undefined') { + if (processInstance && typeof params.to_task_guid === 'undefined') { return processInstance.spiff_step || 0; } @@ -246,7 +246,7 @@ export default function ProcessInstanceShow({ variant }: OwnProps) { return processInstance && currentSpiffStep() === processInstance.spiff_step; }; - const spiffStepLink = (label: any, spiffStep: number) => { + const completionViewLink = (label: any, taskGuid: string) => { const processIdentifier = searchParams.get('process_identifier'); const callActivityTaskId = searchParams.get('bpmn_process_guid'); const queryParamArray = []; @@ -265,29 +265,13 @@ export default function ProcessInstanceShow({ variant }: OwnProps) { {label} ); }; - const previousStepLink = () => { - if (showingFirstSpiffStep()) { - return null; - } - - return spiffStepLink(, currentSpiffStep() - 1); - }; - - const nextStepLink = () => { - if (showingLastSpiffStep()) { - return null; - } - - return spiffStepLink(, currentSpiffStep() + 1); - }; - const returnToLastSpiffStep = () => { window.location.href = processInstanceShowPageBaseUrl; }; @@ -782,10 +766,10 @@ export default function ProcessInstanceShow({ variant }: OwnProps) { } if (task.typename === 'CallActivity') { - console.log('task', task) + console.log('task', task); const taskDefinitionPropertiesJson: TaskDefinitionPropertiesJson = task.task_definition_properties_json; - console.log('taskDefinitionPropertiesJson', taskDefinitionPropertiesJson) + console.log('taskDefinitionPropertiesJson', taskDefinitionPropertiesJson); buttons.push( - {taskToUse.task_spiff_step ? ( -
- - Task completed at step:{' '} - {spiffStepLink( - `${taskToUse.task_spiff_step}`, - taskToUse.task_spiff_step - )} - -
-
-
- ) : null} +
+ + {completionViewLink( + 'View state at task completion', + taskToUse.guid + )} + +
+
+
{selectingEvent ? eventSelector(candidateEvents) : taskDataContainer()} @@ -1015,23 +996,6 @@ export default function ProcessInstanceShow({ variant }: OwnProps) { return null; }; - const stepsElement = () => { - if (!processInstance) { - return null; - } - return ( - - - - {previousStepLink()} - Step {currentSpiffStep()} of {processInstance.spiff_step} - {nextStepLink()} - - - - ); - }; - const buttonIcons = () => { if (!processInstance) { return null; @@ -1119,7 +1083,6 @@ export default function ProcessInstanceShow({ variant }: OwnProps) { {taskUpdateDisplayArea()} {processDataDisplayArea()} {processInstanceMetadataArea()} - {stepsElement()}