Revert "garbage related to trimming down process instance logging"

This reverts commit 4361a5f8ec.
This commit is contained in:
burnettk 2022-10-05 12:07:51 -04:00
parent 4361a5f8ec
commit b588de47c9
4 changed files with 31 additions and 29 deletions

13
poetry.lock generated
View File

@ -1827,22 +1827,25 @@ test = ["pytest"]
[[package]] [[package]]
name = "SpiffWorkflow" name = "SpiffWorkflow"
version = "1.1.7" version = "1.1.7"
description = "A workflow framework and BPMN/DMN Processor" description = ""
category = "main" category = "main"
optional = false optional = false
python-versions = "*" python-versions = "*"
develop = true develop = false
[package.dependencies] [package.dependencies]
celery = "*" celery = "*"
configparser = "*" configparser = "*"
dateparser = "*" dateparser = "*"
importlib-metadata = "<5.0"
lxml = "*" lxml = "*"
pytz = "*" pytz = "*"
[package.source] [package.source]
type = "directory" type = "git"
url = "../SpiffWorkflow" url = "https://github.com/sartography/SpiffWorkflow"
reference = "main"
resolved_reference = "76947aa98d81826b88b2eefd05ebae4427b00e02"
[[package]] [[package]]
name = "SQLAlchemy" name = "SQLAlchemy"
@ -2154,7 +2157,7 @@ testing = ["func-timeout", "jaraco.itertools", "pytest (>=6)", "pytest-black (>=
[metadata] [metadata]
lock-version = "1.1" lock-version = "1.1"
python-versions = "^3.9" python-versions = "^3.9"
content-hash = "5288d4bb2291fc469014bda00cf8da705423a050a20d526a8a089df35c746042" content-hash = "7a3c07a2eef00685adbf44b6e26b740e20fc52bf85e916b6c171b13d4fcc6dc9"
[metadata.files] [metadata.files]
alabaster = [ alabaster = [

View File

@ -28,8 +28,8 @@ flask-migrate = "*"
flask-restful = "*" flask-restful = "*"
werkzeug = "*" werkzeug = "*"
# go back to main once https://github.com/sartography/SpiffWorkflow/pull/241 is merged # go back to main once https://github.com/sartography/SpiffWorkflow/pull/241 is merged
# SpiffWorkflow = {git = "https://github.com/sartography/SpiffWorkflow", rev = "main"} SpiffWorkflow = {git = "https://github.com/sartography/SpiffWorkflow", rev = "main"}
SpiffWorkflow = {develop = true, path = "/Users/kevin/projects/github/sartography/SpiffWorkflow"} # SpiffWorkflow = {develop = true, path = "/Users/kevin/projects/github/sartography/SpiffWorkflow"}
# SpiffWorkflow = {develop = true, path = "/home/jason/projects/github/sartography/SpiffWorkflow"} # SpiffWorkflow = {develop = true, path = "/home/jason/projects/github/sartography/SpiffWorkflow"}
sentry-sdk = "1.9.0" sentry-sdk = "1.9.0"
sphinx-autoapi = "^1.8.4" sphinx-autoapi = "^1.8.4"

View File

@ -845,17 +845,17 @@ def process_instance_task_list(
process_instance = find_process_instance_by_id_or_raise(process_instance_id) process_instance = find_process_instance_by_id_or_raise(process_instance_id)
processor = ProcessInstanceProcessor(process_instance) processor = ProcessInstanceProcessor(process_instance)
# spiff_tasks = None spiff_tasks = None
# if all_tasks: if all_tasks:
# spiff_tasks = processor.bpmn_process_instance.get_tasks(TaskState.ANY_MASK) spiff_tasks = processor.bpmn_process_instance.get_tasks(TaskState.ANY_MASK)
# else: else:
# spiff_tasks = processor.get_all_user_tasks() spiff_tasks = processor.get_all_user_tasks()
tasks = [] tasks = []
# for spiff_task in spiff_tasks: for spiff_task in spiff_tasks:
# task = ProcessInstanceService.spiff_task_to_api_task(spiff_task) task = ProcessInstanceService.spiff_task_to_api_task(spiff_task)
# task.data = spiff_task.data task.data = spiff_task.data
# tasks.append(task) tasks.append(task)
return make_response(jsonify(tasks), 200) return make_response(jsonify(tasks), 200)

View File

@ -271,7 +271,6 @@ class ProcessInstanceProcessor:
self.add_user_info_to_process_instance(self.bpmn_process_instance) self.add_user_info_to_process_instance(self.bpmn_process_instance)
if self.PROCESS_INSTANCE_ID_KEY not in self.bpmn_process_instance.data: if self.PROCESS_INSTANCE_ID_KEY not in self.bpmn_process_instance.data:
if not process_instance_model.id: if not process_instance_model.id:
db.session.add(process_instance_model) db.session.add(process_instance_model)
# If the model is new, and has no id, save it, write it into the process_instance model # If the model is new, and has no id, save it, write it into the process_instance model
@ -419,20 +418,20 @@ class ProcessInstanceProcessor:
"""__get_bpmn_process_instance.""" """__get_bpmn_process_instance."""
if process_instance_model.bpmn_json: if process_instance_model.bpmn_json:
# turn off logging to avoid duplicated spiff logs # turn off logging to avoid duplicated spiff logs
# spiff_logger = logging.getLogger("spiff") spiff_logger = logging.getLogger("spiff")
# original_spiff_logger_log_level = spiff_logger.level original_spiff_logger_log_level = spiff_logger.level
# spiff_logger.setLevel(logging.WARNING) spiff_logger.setLevel(logging.WARNING)
# try: try:
bpmn_process_instance = ( bpmn_process_instance = (
ProcessInstanceProcessor._serializer.deserialize_json( ProcessInstanceProcessor._serializer.deserialize_json(
process_instance_model.bpmn_json process_instance_model.bpmn_json
)
) )
) except Exception as err:
# except Exception as err: raise (err)
# raise (err) finally:
# finally: spiff_logger.setLevel(original_spiff_logger_log_level)
# spiff_logger.setLevel(original_spiff_logger_log_level)
bpmn_process_instance.script_engine = ( bpmn_process_instance.script_engine = (
ProcessInstanceProcessor._script_engine ProcessInstanceProcessor._script_engine