disabled no task data on completed tasks when rehydrating (#706)

Co-authored-by: jasquat <jasquat@users.noreply.github.com>
This commit is contained in:
jasquat 2023-11-21 10:49:16 -05:00 committed by GitHub
parent 762f945e62
commit d737d40ab7
2 changed files with 9 additions and 1 deletions

View File

@ -647,7 +647,9 @@ class ProcessInstanceProcessor:
bpmn_subprocess_id_to_guid_mappings: dict | None = None,
) -> None:
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:
if task.state not in states_to_not_rehydrate_data:
json_data_hashes.add(task.json_data_hash)

View File

@ -9,6 +9,7 @@ from typing import Any
import pytest
from flask.app import Flask
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.models.db import db
from spiffworkflow_backend.models.process_group import ProcessGroup
@ -2114,6 +2115,11 @@ class TestProcessApi(BaseTest):
processor = ProcessInstanceProcessor(process_instance)
spiff_task = processor.get_task_by_bpmn_identifier("script_task_two", processor.bpmn_process_instance)
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()
assert task_model is not None
assert task_model.state == "ERROR"