mirror of
https://github.com/sartography/spiff-arena.git
synced 2025-01-27 09:45:12 +00:00
disabled no task data on completed tasks when rehydrating (#706)
Co-authored-by: jasquat <jasquat@users.noreply.github.com>
This commit is contained in:
parent
762f945e62
commit
d737d40ab7
@ -647,7 +647,9 @@ class ProcessInstanceProcessor:
|
|||||||
bpmn_subprocess_id_to_guid_mappings: dict | None = None,
|
bpmn_subprocess_id_to_guid_mappings: dict | None = None,
|
||||||
) -> None:
|
) -> None:
|
||||||
json_data_hashes = set()
|
json_data_hashes = set()
|
||||||
states_to_not_rehydrate_data = ["COMPLETED", "CANCELLED", "ERROR"]
|
# disable this while we investigate https://github.com/sartography/spiff-arena/issues/705
|
||||||
|
# states_to_not_rehydrate_data = ["COMPLETED", "CANCELLED", "ERROR"]
|
||||||
|
states_to_not_rehydrate_data: list[str] = []
|
||||||
for task in tasks:
|
for task in tasks:
|
||||||
if task.state not in states_to_not_rehydrate_data:
|
if task.state not in states_to_not_rehydrate_data:
|
||||||
json_data_hashes.add(task.json_data_hash)
|
json_data_hashes.add(task.json_data_hash)
|
||||||
|
@ -9,6 +9,7 @@ from typing import Any
|
|||||||
import pytest
|
import pytest
|
||||||
from flask.app import Flask
|
from flask.app import Flask
|
||||||
from flask.testing import FlaskClient
|
from flask.testing import FlaskClient
|
||||||
|
from SpiffWorkflow.util.task import TaskState # type: ignore
|
||||||
from spiffworkflow_backend.exceptions.process_entity_not_found_error import ProcessEntityNotFoundError
|
from spiffworkflow_backend.exceptions.process_entity_not_found_error import ProcessEntityNotFoundError
|
||||||
from spiffworkflow_backend.models.db import db
|
from spiffworkflow_backend.models.db import db
|
||||||
from spiffworkflow_backend.models.process_group import ProcessGroup
|
from spiffworkflow_backend.models.process_group import ProcessGroup
|
||||||
@ -2114,6 +2115,11 @@ class TestProcessApi(BaseTest):
|
|||||||
processor = ProcessInstanceProcessor(process_instance)
|
processor = ProcessInstanceProcessor(process_instance)
|
||||||
spiff_task = processor.get_task_by_bpmn_identifier("script_task_two", processor.bpmn_process_instance)
|
spiff_task = processor.get_task_by_bpmn_identifier("script_task_two", processor.bpmn_process_instance)
|
||||||
assert spiff_task is not None
|
assert spiff_task is not None
|
||||||
|
|
||||||
|
# TODO: remove these 2 lines if we enable no task data on rehydration again from pr-661
|
||||||
|
assert spiff_task.state == TaskState.ERROR
|
||||||
|
assert spiff_task.data == {"my_var": "THE VAR"}
|
||||||
|
|
||||||
task_model = TaskModel.query.filter_by(guid=str(spiff_task.id)).first()
|
task_model = TaskModel.query.filter_by(guid=str(spiff_task.id)).first()
|
||||||
assert task_model is not None
|
assert task_model is not None
|
||||||
assert task_model.state == "ERROR"
|
assert task_model.state == "ERROR"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user