mirror of
https://github.com/sartography/spiff-arena.git
synced 2025-01-12 18:44:14 +00:00
merged in main and resolved conflicts w/ burnettk
This commit is contained in:
commit
b39d718e92
@ -21,6 +21,7 @@ from spiffworkflow_backend.models.bpmn_process import BpmnProcessModel
|
|||||||
from spiffworkflow_backend.models.bpmn_process import BpmnProcessNotFoundError
|
from spiffworkflow_backend.models.bpmn_process import BpmnProcessNotFoundError
|
||||||
from spiffworkflow_backend.models.bpmn_process_definition import BpmnProcessDefinitionModel
|
from spiffworkflow_backend.models.bpmn_process_definition import BpmnProcessDefinitionModel
|
||||||
from spiffworkflow_backend.models.db import db
|
from spiffworkflow_backend.models.db import db
|
||||||
|
from spiffworkflow_backend.models.human_task import HumanTaskModel
|
||||||
from spiffworkflow_backend.models.json_data import JsonDataDict
|
from spiffworkflow_backend.models.json_data import JsonDataDict
|
||||||
from spiffworkflow_backend.models.json_data import JsonDataModel
|
from spiffworkflow_backend.models.json_data import JsonDataModel
|
||||||
from spiffworkflow_backend.models.process_instance import ProcessInstanceModel
|
from spiffworkflow_backend.models.process_instance import ProcessInstanceModel
|
||||||
@ -454,15 +455,14 @@ class TaskService:
|
|||||||
self.task_models[task_model.guid] = task_model
|
self.task_models[task_model.guid] = task_model
|
||||||
|
|
||||||
def update_all_tasks_from_spiff_tasks(
|
def update_all_tasks_from_spiff_tasks(
|
||||||
self,
|
self, spiff_tasks: list[SpiffTask], deleted_spiff_tasks: list[SpiffTask], start_time: float
|
||||||
spiff_tasks: list[SpiffTask],
|
|
||||||
deleted_spiff_tasks: list[SpiffTask],
|
|
||||||
start_time: float
|
|
||||||
) -> None:
|
) -> None:
|
||||||
# Remove all the deleted/pruned tasks from the database.
|
# Remove all the deleted/pruned tasks from the database.
|
||||||
deleted_task_ids = list(map(lambda t: str(t.id), deleted_spiff_tasks))
|
deleted_task_ids = list(map(lambda t: str(t.id), deleted_spiff_tasks))
|
||||||
tasks_to_clear = TaskModel.query.filter(TaskModel.guid.in_(deleted_task_ids)).all() # type: ignore
|
tasks_to_clear = TaskModel.query.filter(TaskModel.guid.in_(deleted_task_ids)).all() # type: ignore
|
||||||
human_tasks_to_clear = HumanTaskModel.query.filter(HumanTaskModel.task_id.in_(deleted_task_ids)).all() # type: ignore
|
human_tasks_to_clear = HumanTaskModel.query.filter(
|
||||||
|
HumanTaskModel.task_id.in_(deleted_task_ids) # type: ignore
|
||||||
|
).all()
|
||||||
for task in tasks_to_clear + human_tasks_to_clear:
|
for task in tasks_to_clear + human_tasks_to_clear:
|
||||||
db.session.delete(task)
|
db.session.delete(task)
|
||||||
|
|
||||||
|
@ -176,8 +176,10 @@ export default function TaskShow() {
|
|||||||
if (disabled) {
|
if (disabled) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!formObject) {
|
const dataToSubmit = formObject?.formData;
|
||||||
|
if (!dataToSubmit) {
|
||||||
navigate(`/tasks`);
|
navigate(`/tasks`);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
let queryParams = '';
|
let queryParams = '';
|
||||||
if (submitType === FormSubmitType.Draft) {
|
if (submitType === FormSubmitType.Draft) {
|
||||||
@ -185,7 +187,6 @@ export default function TaskShow() {
|
|||||||
}
|
}
|
||||||
setDisabled(true);
|
setDisabled(true);
|
||||||
removeError();
|
removeError();
|
||||||
const dataToSubmit = formObject.formData;
|
|
||||||
delete dataToSubmit.isManualTask;
|
delete dataToSubmit.isManualTask;
|
||||||
HttpService.makeCallToBackend({
|
HttpService.makeCallToBackend({
|
||||||
path: `/tasks/${params.process_instance_id}/${params.task_id}${queryParams}`,
|
path: `/tasks/${params.process_instance_id}/${params.task_id}${queryParams}`,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user