Merge pull request #291 from sartography/feature/fix_process_instance_terminate
allow not redirecting to home page at all in interstitial component a…
This commit is contained in:
commit
5d19d7cd61
|
@ -430,20 +430,21 @@ def _interstitial_stream(process_instance: ProcessInstanceModel) -> Generator[st
|
|||
break # No more tasks to report
|
||||
|
||||
spiff_task = processor.next_task()
|
||||
task = ProcessInstanceService.spiff_task_to_api_task(processor, processor.next_task())
|
||||
if task.id not in reported_ids:
|
||||
try:
|
||||
instructions = render_instructions(spiff_task)
|
||||
except Exception as e:
|
||||
api_error = ApiError(
|
||||
error_code="engine_steps_error",
|
||||
message=f"Failed to complete an automated task. Error was: {str(e)}",
|
||||
status_code=400,
|
||||
)
|
||||
yield render_data("error", api_error)
|
||||
raise e
|
||||
task.properties = {"instructionsForEndUser": instructions}
|
||||
yield render_data("task", task)
|
||||
if spiff_task is not None:
|
||||
task = ProcessInstanceService.spiff_task_to_api_task(processor, spiff_task)
|
||||
if task.id not in reported_ids:
|
||||
try:
|
||||
instructions = render_instructions(spiff_task)
|
||||
except Exception as e:
|
||||
api_error = ApiError(
|
||||
error_code="engine_steps_error",
|
||||
message=f"Failed to complete an automated task. Error was: {str(e)}",
|
||||
status_code=400,
|
||||
)
|
||||
yield render_data("error", api_error)
|
||||
raise e
|
||||
task.properties = {"instructionsForEndUser": instructions}
|
||||
yield render_data("task", task)
|
||||
|
||||
|
||||
def get_ready_engine_step_count(bpmn_process_instance: BpmnWorkflow) -> int:
|
||||
|
|
|
@ -514,7 +514,6 @@ class ProcessInstanceService:
|
|||
add_docs_and_forms: bool = False,
|
||||
calling_subprocess_task_id: str | None = None,
|
||||
) -> Task:
|
||||
"""Spiff_task_to_api_task."""
|
||||
task_type = spiff_task.task_spec.description
|
||||
|
||||
props = {}
|
||||
|
|
|
@ -490,6 +490,7 @@ export default function ProcessInstanceListTable({
|
|||
HttpService.makeCallToBackend({
|
||||
path: `/process-instances/report-metadata${queryParamString}`,
|
||||
successCallback: getProcessInstances,
|
||||
onUnauthorized: stopRefreshing,
|
||||
});
|
||||
} else {
|
||||
getProcessInstances();
|
||||
|
@ -542,6 +543,7 @@ export default function ProcessInstanceListTable({
|
|||
permissionsLoaded,
|
||||
reportIdentifier,
|
||||
searchParams,
|
||||
stopRefreshing,
|
||||
]);
|
||||
|
||||
const processInstanceReportSaveTag = () => {
|
||||
|
|
|
@ -49,7 +49,6 @@ export default function ProcessInterstitial({
|
|||
}
|
||||
},
|
||||
onclose() {
|
||||
console.log('The state is closed.');
|
||||
setState('CLOSED');
|
||||
},
|
||||
});
|
||||
|
@ -161,7 +160,7 @@ export default function ProcessInterstitial({
|
|||
|
||||
/** In the event there is no task information and the connection closed,
|
||||
* redirect to the home page. */
|
||||
if (state === 'CLOSED' && lastTask === null) {
|
||||
if (state === 'CLOSED' && lastTask === null && allowRedirect) {
|
||||
navigate(`/tasks`);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue