renames
This commit is contained in:
parent
bfae6ac63d
commit
2eb3ef6aa3
|
@ -74,7 +74,7 @@ def main():
|
||||||
print(f"ticket_identifier: {ticket_identifier}")
|
print(f"ticket_identifier: {ticket_identifier}")
|
||||||
print(f"priority: {priority}")
|
print(f"priority: {priority}")
|
||||||
|
|
||||||
process_instance = ProcessInstanceService.create_process_instance(
|
process_instance = ProcessInstanceService.create_process_instance_from_process_model_identifier(
|
||||||
process_model_identifier_ticket,
|
process_model_identifier_ticket,
|
||||||
user,
|
user,
|
||||||
process_group_identifier="sartography-admin",
|
process_group_identifier="sartography-admin",
|
||||||
|
|
|
@ -68,7 +68,7 @@ def main():
|
||||||
print(f"priority: {priority}")
|
print(f"priority: {priority}")
|
||||||
# if there is no month, who cares about it.
|
# if there is no month, who cares about it.
|
||||||
if month:
|
if month:
|
||||||
process_instance = ProcessInstanceService.create_process_instance(
|
process_instance = ProcessInstanceService.create_process_instance_from_process_model_identifier(
|
||||||
process_model_identifier=process_model_identifier_ticket,
|
process_model_identifier=process_model_identifier_ticket,
|
||||||
user=user,
|
user=user,
|
||||||
process_group_identifier="sartography-admin",
|
process_group_identifier="sartography-admin",
|
||||||
|
|
|
@ -96,7 +96,7 @@ def setup_process_instances_for_reports(
|
||||||
# )
|
# )
|
||||||
process_instances = []
|
process_instances = []
|
||||||
for data in [kay(), ray(), jay()]:
|
for data in [kay(), ray(), jay()]:
|
||||||
process_instance = ProcessInstanceService.create_process_instance(
|
process_instance = ProcessInstanceService.create_process_instance_from_process_model_identifier(
|
||||||
# process_group_identifier=process_group_id,
|
# process_group_identifier=process_group_id,
|
||||||
process_model_identifier=process_model_identifier,
|
process_model_identifier=process_model_identifier,
|
||||||
user=user,
|
user=user,
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
from __future__ import with_statement
|
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
from logging.config import fileConfig
|
from logging.config import fileConfig
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
"""Process_instance."""
|
"""Process_instance."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from dataclasses import dataclass
|
|
||||||
from typing import Any
|
from typing import Any
|
||||||
from typing import cast
|
from typing import cast
|
||||||
|
|
||||||
|
@ -18,7 +17,6 @@ from sqlalchemy.orm import relationship
|
||||||
from sqlalchemy.orm import validates
|
from sqlalchemy.orm import validates
|
||||||
|
|
||||||
from spiffworkflow_backend.helpers.spiff_enum import SpiffEnum
|
from spiffworkflow_backend.helpers.spiff_enum import SpiffEnum
|
||||||
from spiffworkflow_backend.models.process_model import ProcessModelInfo
|
|
||||||
from spiffworkflow_backend.models.task import Task
|
from spiffworkflow_backend.models.task import Task
|
||||||
from spiffworkflow_backend.models.task import TaskSchema
|
from spiffworkflow_backend.models.task import TaskSchema
|
||||||
from spiffworkflow_backend.models.user import UserModel
|
from spiffworkflow_backend.models.user import UserModel
|
||||||
|
|
|
@ -75,7 +75,7 @@ class ProcessInstanceReportModel(SpiffworkflowBaseDBModel):
|
||||||
def add_fixtures(cls) -> None:
|
def add_fixtures(cls) -> None:
|
||||||
"""Add_fixtures."""
|
"""Add_fixtures."""
|
||||||
try:
|
try:
|
||||||
# process_model = ProcessModelService().get_process_model(
|
# process_model = ProcessModelService.get_process_model(
|
||||||
# process_model_id="sartography-admin/ticket"
|
# process_model_id="sartography-admin/ticket"
|
||||||
# )
|
# )
|
||||||
user = UserModel.query.first()
|
user = UserModel.query.first()
|
||||||
|
@ -205,7 +205,7 @@ class ProcessInstanceReportModel(SpiffworkflowBaseDBModel):
|
||||||
) -> ProcessInstanceReportModel:
|
) -> ProcessInstanceReportModel:
|
||||||
"""Create_with_attributes."""
|
"""Create_with_attributes."""
|
||||||
# <<<<<<< HEAD
|
# <<<<<<< HEAD
|
||||||
# process_model = ProcessModelService().get_process_model(
|
# process_model = ProcessModelService.get_process_model(
|
||||||
# process_model_id=f"{process_model_identifier}"
|
# process_model_id=f"{process_model_identifier}"
|
||||||
# )
|
# )
|
||||||
# process_instance_report = cls(
|
# process_instance_report = cls(
|
||||||
|
|
|
@ -43,7 +43,7 @@ def process_group_show(process_group_id: str) -> str:
|
||||||
@admin_blueprint.route("/process-models/<process_model_id>", methods=["GET"])
|
@admin_blueprint.route("/process-models/<process_model_id>", methods=["GET"])
|
||||||
def process_model_show(process_model_id: str) -> Union[str, Response]:
|
def process_model_show(process_model_id: str) -> Union[str, Response]:
|
||||||
"""Show_process_model."""
|
"""Show_process_model."""
|
||||||
process_model = ProcessModelService().get_process_model(process_model_id)
|
process_model = ProcessModelService.get_process_model(process_model_id)
|
||||||
files = SpecFileService.get_files(process_model, extension_filter="bpmn")
|
files = SpecFileService.get_files(process_model, extension_filter="bpmn")
|
||||||
current_file_name = process_model.primary_file_name
|
current_file_name = process_model.primary_file_name
|
||||||
if current_file_name is None:
|
if current_file_name is None:
|
||||||
|
@ -64,7 +64,7 @@ def process_model_show(process_model_id: str) -> Union[str, Response]:
|
||||||
)
|
)
|
||||||
def process_model_show_file(process_model_id: str, file_name: str) -> str:
|
def process_model_show_file(process_model_id: str, file_name: str) -> str:
|
||||||
"""Process_model_show_file."""
|
"""Process_model_show_file."""
|
||||||
process_model = ProcessModelService().get_process_model(process_model_id)
|
process_model = ProcessModelService.get_process_model(process_model_id)
|
||||||
bpmn_xml = SpecFileService.get_data(process_model, file_name)
|
bpmn_xml = SpecFileService.get_data(process_model, file_name)
|
||||||
files = SpecFileService.get_files(process_model, extension_filter="bpmn")
|
files = SpecFileService.get_files(process_model, extension_filter="bpmn")
|
||||||
return render_template(
|
return render_template(
|
||||||
|
@ -109,7 +109,7 @@ def process_model_upload_file(process_model_id: str) -> Response:
|
||||||
)
|
)
|
||||||
def process_model_edit(process_model_id: str, file_name: str) -> str:
|
def process_model_edit(process_model_id: str, file_name: str) -> str:
|
||||||
"""Edit_bpmn."""
|
"""Edit_bpmn."""
|
||||||
process_model = ProcessModelService().get_process_model(process_model_id)
|
process_model = ProcessModelService.get_process_model(process_model_id)
|
||||||
bpmn_xml = SpecFileService.get_data(process_model, file_name)
|
bpmn_xml = SpecFileService.get_data(process_model, file_name)
|
||||||
|
|
||||||
return render_template(
|
return render_template(
|
||||||
|
@ -125,7 +125,7 @@ def process_model_edit(process_model_id: str, file_name: str) -> str:
|
||||||
)
|
)
|
||||||
def process_model_save(process_model_id: str, file_name: str) -> Union[str, Response]:
|
def process_model_save(process_model_id: str, file_name: str) -> Union[str, Response]:
|
||||||
"""Process_model_save."""
|
"""Process_model_save."""
|
||||||
process_model = ProcessModelService().get_process_model(process_model_id)
|
process_model = ProcessModelService.get_process_model(process_model_id)
|
||||||
SpecFileService.update_file(process_model, file_name, request.get_data())
|
SpecFileService.update_file(process_model, file_name, request.get_data())
|
||||||
if process_model.primary_file_name is None:
|
if process_model.primary_file_name is None:
|
||||||
flash("No primary_file_name", "error")
|
flash("No primary_file_name", "error")
|
||||||
|
@ -143,14 +143,16 @@ def process_model_save(process_model_id: str, file_name: str) -> Union[str, Resp
|
||||||
def process_model_run(process_model_id: str) -> Union[str, Response]:
|
def process_model_run(process_model_id: str) -> Union[str, Response]:
|
||||||
"""Process_model_run."""
|
"""Process_model_run."""
|
||||||
user = UserService.create_user("internal", "Mr. Test", username="Mr. Test")
|
user = UserService.create_user("internal", "Mr. Test", username="Mr. Test")
|
||||||
process_instance = ProcessInstanceService.create_process_instance(
|
process_instance = (
|
||||||
process_model_id, user
|
ProcessInstanceService.create_process_instance_from_process_model_identifier(
|
||||||
|
process_model_id, user
|
||||||
|
)
|
||||||
)
|
)
|
||||||
processor = ProcessInstanceProcessor(process_instance)
|
processor = ProcessInstanceProcessor(process_instance)
|
||||||
processor.do_engine_steps()
|
processor.do_engine_steps()
|
||||||
result = processor.get_data()
|
result = processor.get_data()
|
||||||
|
|
||||||
process_model = ProcessModelService().get_process_model(process_model_id)
|
process_model = ProcessModelService.get_process_model(process_model_id)
|
||||||
files = SpecFileService.get_files(process_model, extension_filter="bpmn")
|
files = SpecFileService.get_files(process_model, extension_filter="bpmn")
|
||||||
current_file_name = process_model.primary_file_name
|
current_file_name = process_model.primary_file_name
|
||||||
if current_file_name is None:
|
if current_file_name is None:
|
||||||
|
|
|
@ -363,7 +363,7 @@ def process_model_list(
|
||||||
per_page: int = 100,
|
per_page: int = 100,
|
||||||
) -> flask.wrappers.Response:
|
) -> flask.wrappers.Response:
|
||||||
"""Process model list!"""
|
"""Process model list!"""
|
||||||
process_models = ProcessModelService().get_process_models(
|
process_models = ProcessModelService.get_process_models(
|
||||||
process_group_id=process_group_identifier,
|
process_group_id=process_group_identifier,
|
||||||
recursive=recursive,
|
recursive=recursive,
|
||||||
filter_runnable_by_user=filter_runnable_by_user,
|
filter_runnable_by_user=filter_runnable_by_user,
|
||||||
|
@ -495,8 +495,10 @@ def process_instance_create(modified_process_model_id: str) -> flask.wrappers.Re
|
||||||
process_model_identifier = un_modify_modified_process_model_id(
|
process_model_identifier = un_modify_modified_process_model_id(
|
||||||
modified_process_model_id
|
modified_process_model_id
|
||||||
)
|
)
|
||||||
process_instance = ProcessInstanceService.create_process_instance(
|
process_instance = (
|
||||||
process_model_identifier, g.user
|
ProcessInstanceService.create_process_instance_from_process_model_identifier(
|
||||||
|
process_model_identifier, g.user
|
||||||
|
)
|
||||||
)
|
)
|
||||||
return Response(
|
return Response(
|
||||||
json.dumps(ProcessInstanceModelSchema().dump(process_instance)),
|
json.dumps(ProcessInstanceModelSchema().dump(process_instance)),
|
||||||
|
@ -1595,7 +1597,7 @@ def get_process_model(process_model_id: str) -> ProcessModelInfo:
|
||||||
"""Get_process_model."""
|
"""Get_process_model."""
|
||||||
process_model = None
|
process_model = None
|
||||||
try:
|
try:
|
||||||
process_model = ProcessModelService().get_process_model(process_model_id)
|
process_model = ProcessModelService.get_process_model(process_model_id)
|
||||||
except ProcessEntityNotFoundError as exception:
|
except ProcessEntityNotFoundError as exception:
|
||||||
raise (
|
raise (
|
||||||
ApiError(
|
ApiError(
|
||||||
|
|
|
@ -30,7 +30,7 @@ def load_acceptance_test_fixtures() -> list[ProcessInstanceModel]:
|
||||||
process_instances = []
|
process_instances = []
|
||||||
for i in range(len(statuses)):
|
for i in range(len(statuses)):
|
||||||
|
|
||||||
process_instance = ProcessInstanceService.create_process_instance(
|
process_instance = ProcessInstanceService.create_process_instance_from_process_model_identifier(
|
||||||
test_process_model_id, user
|
test_process_model_id, user
|
||||||
)
|
)
|
||||||
process_instance.status = statuses[i]
|
process_instance.status = statuses[i]
|
||||||
|
|
|
@ -26,7 +26,7 @@ class DataSetupService:
|
||||||
|
|
||||||
current_app.logger.debug("DataSetupService.save_all_process_models() start")
|
current_app.logger.debug("DataSetupService.save_all_process_models() start")
|
||||||
failing_process_models = []
|
failing_process_models = []
|
||||||
process_models = ProcessModelService().get_process_models(recursive=True)
|
process_models = ProcessModelService.get_process_models(recursive=True)
|
||||||
SpecFileService.clear_caches()
|
SpecFileService.clear_caches()
|
||||||
for process_model in process_models:
|
for process_model in process_models:
|
||||||
current_app.logger.debug(f"Process Model: {process_model.display_name}")
|
current_app.logger.debug(f"Process Model: {process_model.display_name}")
|
||||||
|
|
|
@ -34,7 +34,7 @@ class ErrorHandlingService:
|
||||||
self, _processor: ProcessInstanceProcessor, _error: Union[ApiError, Exception]
|
self, _processor: ProcessInstanceProcessor, _error: Union[ApiError, Exception]
|
||||||
) -> None:
|
) -> None:
|
||||||
"""On unhandled exceptions, set instance.status based on model.fault_or_suspend_on_exception."""
|
"""On unhandled exceptions, set instance.status based on model.fault_or_suspend_on_exception."""
|
||||||
process_model = ProcessModelService().get_process_model(
|
process_model = ProcessModelService.get_process_model(
|
||||||
_processor.process_model_identifier
|
_processor.process_model_identifier
|
||||||
)
|
)
|
||||||
if process_model.fault_or_suspend_on_exception == "suspend":
|
if process_model.fault_or_suspend_on_exception == "suspend":
|
||||||
|
|
|
@ -117,7 +117,7 @@ class MessageService:
|
||||||
user: UserModel,
|
user: UserModel,
|
||||||
) -> ProcessInstanceModel:
|
) -> ProcessInstanceModel:
|
||||||
"""Process_message_triggerable_process_model."""
|
"""Process_message_triggerable_process_model."""
|
||||||
process_instance_receive = ProcessInstanceService.create_process_instance(
|
process_instance_receive = ProcessInstanceService.create_process_instance_from_process_model_identifier(
|
||||||
message_triggerable_process_model.process_model_identifier,
|
message_triggerable_process_model.process_model_identifier,
|
||||||
user,
|
user,
|
||||||
)
|
)
|
||||||
|
|
|
@ -349,7 +349,9 @@ class ProcessInstanceProcessor:
|
||||||
check_sub_specs(test_spec, 5)
|
check_sub_specs(test_spec, 5)
|
||||||
|
|
||||||
self.process_model_identifier = process_instance_model.process_model_identifier
|
self.process_model_identifier = process_instance_model.process_model_identifier
|
||||||
self.process_model_display_name = process_instance_model.process_model_display_name
|
self.process_model_display_name = (
|
||||||
|
process_instance_model.process_model_display_name
|
||||||
|
)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
self.bpmn_process_instance = self.__get_bpmn_process_instance(
|
self.bpmn_process_instance = self.__get_bpmn_process_instance(
|
||||||
|
@ -374,7 +376,7 @@ class ProcessInstanceProcessor:
|
||||||
cls, process_model_identifier: str
|
cls, process_model_identifier: str
|
||||||
) -> Tuple[BpmnProcessSpec, IdToBpmnProcessSpecMapping]:
|
) -> Tuple[BpmnProcessSpec, IdToBpmnProcessSpecMapping]:
|
||||||
"""Get_process_model_and_subprocesses."""
|
"""Get_process_model_and_subprocesses."""
|
||||||
process_model_info = ProcessModelService().get_process_model(
|
process_model_info = ProcessModelService.get_process_model(
|
||||||
process_model_identifier
|
process_model_identifier
|
||||||
)
|
)
|
||||||
if process_model_info is None:
|
if process_model_info is None:
|
||||||
|
@ -662,7 +664,7 @@ class ProcessInstanceProcessor:
|
||||||
bpmn_process_identifier: str,
|
bpmn_process_identifier: str,
|
||||||
) -> Optional[str]:
|
) -> Optional[str]:
|
||||||
"""Backfill_missing_spec_reference_records."""
|
"""Backfill_missing_spec_reference_records."""
|
||||||
process_models = ProcessModelService().get_process_models(recursive=True)
|
process_models = ProcessModelService.get_process_models(recursive=True)
|
||||||
for process_model in process_models:
|
for process_model in process_models:
|
||||||
try:
|
try:
|
||||||
refs = SpecFileService.reference_map(
|
refs = SpecFileService.reference_map(
|
||||||
|
|
|
@ -29,8 +29,9 @@ class ProcessInstanceService:
|
||||||
|
|
||||||
TASK_STATE_LOCKED = "locked"
|
TASK_STATE_LOCKED = "locked"
|
||||||
|
|
||||||
@staticmethod
|
@classmethod
|
||||||
def create_process_instance(
|
def create_process_instance(
|
||||||
|
cls,
|
||||||
process_model: ProcessModelInfo,
|
process_model: ProcessModelInfo,
|
||||||
user: UserModel,
|
user: UserModel,
|
||||||
) -> ProcessInstanceModel:
|
) -> ProcessInstanceModel:
|
||||||
|
@ -49,6 +50,16 @@ class ProcessInstanceService:
|
||||||
db.session.commit()
|
db.session.commit()
|
||||||
return process_instance_model
|
return process_instance_model
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def create_process_instance_from_process_model_identifier(
|
||||||
|
cls,
|
||||||
|
process_model_identifier: str,
|
||||||
|
user: UserModel,
|
||||||
|
) -> ProcessInstanceModel:
|
||||||
|
"""Create_process_instance_from_process_model_identifier."""
|
||||||
|
process_model = ProcessModelService.get_process_model(process_model_identifier)
|
||||||
|
return cls.create_process_instance(process_model, user)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def do_waiting() -> None:
|
def do_waiting() -> None:
|
||||||
"""Do_waiting."""
|
"""Do_waiting."""
|
||||||
|
@ -89,7 +100,7 @@ class ProcessInstanceService:
|
||||||
process_model = process_model_service.get_process_model(
|
process_model = process_model_service.get_process_model(
|
||||||
processor.process_model_identifier
|
processor.process_model_identifier
|
||||||
)
|
)
|
||||||
title_value = process_model.display_name if process_model else ""
|
process_model.display_name if process_model else ""
|
||||||
process_instance_api = ProcessInstanceApi(
|
process_instance_api = ProcessInstanceApi(
|
||||||
id=processor.get_process_instance_id(),
|
id=processor.get_process_instance_id(),
|
||||||
status=processor.get_status(),
|
status=processor.get_status(),
|
||||||
|
|
|
@ -44,9 +44,10 @@ class ProcessModelService(FileSystemService):
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def is_model(self, path: str) -> bool:
|
@classmethod
|
||||||
|
def is_model(cls, path: str) -> bool:
|
||||||
"""Is_model."""
|
"""Is_model."""
|
||||||
model_json_path = os.path.join(path, self.PROCESS_MODEL_JSON_FILE)
|
model_json_path = os.path.join(path, cls.PROCESS_MODEL_JSON_FILE)
|
||||||
if os.path.exists(model_json_path):
|
if os.path.exists(model_json_path):
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
@ -144,7 +145,8 @@ class ProcessModelService(FileSystemService):
|
||||||
path = os.path.join(FileSystemService.root_path(), relative_path)
|
path = os.path.join(FileSystemService.root_path(), relative_path)
|
||||||
return cls().__scan_process_model(path, process_group=process_group)
|
return cls().__scan_process_model(path, process_group=process_group)
|
||||||
|
|
||||||
def get_process_model(self, process_model_id: str) -> ProcessModelInfo:
|
@classmethod
|
||||||
|
def get_process_model(cls, process_model_id: str) -> ProcessModelInfo:
|
||||||
"""Get a process model from a model and group id.
|
"""Get a process model from a model and group id.
|
||||||
|
|
||||||
process_model_id is the full path to the model--including groups.
|
process_model_id is the full path to the model--including groups.
|
||||||
|
@ -155,7 +157,7 @@ class ProcessModelService(FileSystemService):
|
||||||
model_path = os.path.abspath(
|
model_path = os.path.abspath(
|
||||||
os.path.join(FileSystemService.root_path(), process_model_id)
|
os.path.join(FileSystemService.root_path(), process_model_id)
|
||||||
)
|
)
|
||||||
if self.is_model(model_path):
|
if cls.is_model(model_path):
|
||||||
process_model = self.get_process_model_from_relative_path(process_model_id)
|
process_model = self.get_process_model_from_relative_path(process_model_id)
|
||||||
return process_model
|
return process_model
|
||||||
raise ProcessEntityNotFoundError("process_model_not_found")
|
raise ProcessEntityNotFoundError("process_model_not_found")
|
||||||
|
@ -285,7 +287,7 @@ class ProcessModelService(FileSystemService):
|
||||||
for _root, dirs, _files in os.walk(group_path):
|
for _root, dirs, _files in os.walk(group_path):
|
||||||
for dir in dirs:
|
for dir in dirs:
|
||||||
model_dir = os.path.join(group_path, dir)
|
model_dir = os.path.join(group_path, dir)
|
||||||
if ProcessModelService().is_model(model_dir):
|
if ProcessModelService.is_model(model_dir):
|
||||||
process_model = self.get_process_model(model_dir)
|
process_model = self.get_process_model(model_dir)
|
||||||
all_nested_models.append(process_model)
|
all_nested_models.append(process_model)
|
||||||
return all_nested_models
|
return all_nested_models
|
||||||
|
@ -382,7 +384,7 @@ class ProcessModelService(FileSystemService):
|
||||||
process_group.process_groups.append(
|
process_group.process_groups.append(
|
||||||
self.find_or_create_process_group(nested_item.path)
|
self.find_or_create_process_group(nested_item.path)
|
||||||
)
|
)
|
||||||
elif self.is_model(nested_item.path):
|
elif ProcessModelService.is_model(nested_item.path):
|
||||||
process_group.process_models.append(
|
process_group.process_models.append(
|
||||||
self.__scan_process_model(
|
self.__scan_process_model(
|
||||||
nested_item.path,
|
nested_item.path,
|
||||||
|
|
|
@ -133,7 +133,7 @@ class TestProcessApi(BaseTest):
|
||||||
process_model_description=model_description,
|
process_model_description=model_description,
|
||||||
user=with_super_admin_user,
|
user=with_super_admin_user,
|
||||||
)
|
)
|
||||||
process_model = ProcessModelService().get_process_model(
|
process_model = ProcessModelService.get_process_model(
|
||||||
process_model_identifier,
|
process_model_identifier,
|
||||||
)
|
)
|
||||||
assert model_display_name == process_model.display_name
|
assert model_display_name == process_model.display_name
|
||||||
|
@ -155,9 +155,7 @@ class TestProcessApi(BaseTest):
|
||||||
user=with_super_admin_user,
|
user=with_super_admin_user,
|
||||||
)
|
)
|
||||||
# get the model, assert that primary is set
|
# get the model, assert that primary is set
|
||||||
process_model = ProcessModelService().get_process_model(
|
process_model = ProcessModelService.get_process_model(process_model_identifier)
|
||||||
process_model_identifier
|
|
||||||
)
|
|
||||||
assert process_model.primary_file_name == bpmn_file_name
|
assert process_model.primary_file_name == bpmn_file_name
|
||||||
assert process_model.primary_process_id == "sample"
|
assert process_model.primary_process_id == "sample"
|
||||||
|
|
||||||
|
@ -208,9 +206,7 @@ class TestProcessApi(BaseTest):
|
||||||
headers=self.logged_in_headers(with_super_admin_user),
|
headers=self.logged_in_headers(with_super_admin_user),
|
||||||
)
|
)
|
||||||
assert response.status_code == 200
|
assert response.status_code == 200
|
||||||
process_model = ProcessModelService().get_process_model(
|
process_model = ProcessModelService.get_process_model(process_model_identifier)
|
||||||
process_model_identifier
|
|
||||||
)
|
|
||||||
assert process_model.primary_file_name == bpmn_file_name
|
assert process_model.primary_file_name == bpmn_file_name
|
||||||
assert process_model.primary_process_id == terminal_primary_process_id
|
assert process_model.primary_process_id == terminal_primary_process_id
|
||||||
|
|
||||||
|
@ -236,9 +232,7 @@ class TestProcessApi(BaseTest):
|
||||||
)
|
)
|
||||||
|
|
||||||
# assert we have a model
|
# assert we have a model
|
||||||
process_model = ProcessModelService().get_process_model(
|
process_model = ProcessModelService.get_process_model(process_model_identifier)
|
||||||
process_model_identifier
|
|
||||||
)
|
|
||||||
assert process_model is not None
|
assert process_model is not None
|
||||||
assert process_model.id == process_model_identifier
|
assert process_model.id == process_model_identifier
|
||||||
|
|
||||||
|
@ -254,7 +248,7 @@ class TestProcessApi(BaseTest):
|
||||||
|
|
||||||
# assert we no longer have a model
|
# assert we no longer have a model
|
||||||
with pytest.raises(ProcessEntityNotFoundError):
|
with pytest.raises(ProcessEntityNotFoundError):
|
||||||
ProcessModelService().get_process_model(process_model_identifier)
|
ProcessModelService.get_process_model(process_model_identifier)
|
||||||
|
|
||||||
def test_process_model_delete_with_instances(
|
def test_process_model_delete_with_instances(
|
||||||
self,
|
self,
|
||||||
|
@ -327,9 +321,7 @@ class TestProcessApi(BaseTest):
|
||||||
process_model_id=process_model_identifier,
|
process_model_id=process_model_identifier,
|
||||||
user=with_super_admin_user,
|
user=with_super_admin_user,
|
||||||
)
|
)
|
||||||
process_model = ProcessModelService().get_process_model(
|
process_model = ProcessModelService.get_process_model(process_model_identifier)
|
||||||
process_model_identifier
|
|
||||||
)
|
|
||||||
assert process_model.id == process_model_identifier
|
assert process_model.id == process_model_identifier
|
||||||
assert process_model.display_name == "Cooooookies"
|
assert process_model.display_name == "Cooooookies"
|
||||||
assert process_model.primary_file_name is None
|
assert process_model.primary_file_name is None
|
||||||
|
@ -1902,9 +1894,7 @@ class TestProcessApi(BaseTest):
|
||||||
process_instance_id = self.setup_testing_instance(
|
process_instance_id = self.setup_testing_instance(
|
||||||
client, process_model_identifier, with_super_admin_user
|
client, process_model_identifier, with_super_admin_user
|
||||||
)
|
)
|
||||||
process_model = ProcessModelService().get_process_model(
|
process_model = ProcessModelService.get_process_model(process_model_identifier)
|
||||||
process_model_identifier
|
|
||||||
)
|
|
||||||
ProcessModelService().update_process_model(
|
ProcessModelService().update_process_model(
|
||||||
process_model,
|
process_model,
|
||||||
{"fault_or_suspend_on_exception": NotificationType.suspend.value},
|
{"fault_or_suspend_on_exception": NotificationType.suspend.value},
|
||||||
|
@ -1957,9 +1947,7 @@ class TestProcessApi(BaseTest):
|
||||||
client, process_model_identifier, with_super_admin_user
|
client, process_model_identifier, with_super_admin_user
|
||||||
)
|
)
|
||||||
|
|
||||||
process_model = ProcessModelService().get_process_model(
|
process_model = ProcessModelService.get_process_model(process_model_identifier)
|
||||||
process_model_identifier
|
|
||||||
)
|
|
||||||
ProcessModelService().update_process_model(
|
ProcessModelService().update_process_model(
|
||||||
process_model,
|
process_model,
|
||||||
{"exception_notification_addresses": ["with_super_admin_user@example.com"]},
|
{"exception_notification_addresses": ["with_super_admin_user@example.com"]},
|
||||||
|
@ -2483,7 +2471,7 @@ class TestProcessApi(BaseTest):
|
||||||
process_model_display_name=process_model_id,
|
process_model_display_name=process_model_id,
|
||||||
process_model_description=process_model_id,
|
process_model_description=process_model_id,
|
||||||
)
|
)
|
||||||
persisted = ProcessModelService().get_process_model(original_process_model_path)
|
persisted = ProcessModelService.get_process_model(original_process_model_path)
|
||||||
assert persisted is not None
|
assert persisted is not None
|
||||||
assert persisted.id == original_process_model_path
|
assert persisted.id == original_process_model_path
|
||||||
|
|
||||||
|
@ -2503,11 +2491,11 @@ class TestProcessApi(BaseTest):
|
||||||
|
|
||||||
# make sure the original model does not exist
|
# make sure the original model does not exist
|
||||||
with pytest.raises(ProcessEntityNotFoundError) as e:
|
with pytest.raises(ProcessEntityNotFoundError) as e:
|
||||||
ProcessModelService().get_process_model(original_process_model_path)
|
ProcessModelService.get_process_model(original_process_model_path)
|
||||||
assert e.value.args[0] == "process_model_not_found"
|
assert e.value.args[0] == "process_model_not_found"
|
||||||
|
|
||||||
# make sure the new model does exist
|
# make sure the new model does exist
|
||||||
new_process_model = ProcessModelService().get_process_model(
|
new_process_model = ProcessModelService.get_process_model(
|
||||||
new_process_model_path
|
new_process_model_path
|
||||||
)
|
)
|
||||||
assert new_process_model is not None
|
assert new_process_model is not None
|
||||||
|
|
|
@ -52,7 +52,7 @@ class SecretServiceTestHelpers(BaseTest):
|
||||||
process_model_description=self.test_process_model_description,
|
process_model_description=self.test_process_model_description,
|
||||||
user=user,
|
user=user,
|
||||||
)
|
)
|
||||||
process_model_info = ProcessModelService().get_process_model(
|
process_model_info = ProcessModelService.get_process_model(
|
||||||
process_model_identifier
|
process_model_identifier
|
||||||
)
|
)
|
||||||
return process_model_info
|
return process_model_info
|
||||||
|
|
|
@ -113,7 +113,7 @@ class TestAuthorizationService(BaseTest):
|
||||||
bpmn_file_location="model_with_lanes",
|
bpmn_file_location="model_with_lanes",
|
||||||
)
|
)
|
||||||
|
|
||||||
process_model = ProcessModelService().get_process_model(
|
process_model = ProcessModelService.get_process_model(
|
||||||
process_model_id=process_model_identifier
|
process_model_id=process_model_identifier
|
||||||
)
|
)
|
||||||
process_instance = self.create_process_instance_from_process_model(
|
process_instance = self.create_process_instance_from_process_model(
|
||||||
|
|
|
@ -44,7 +44,7 @@ class TestMessageInstance(BaseTest):
|
||||||
client, with_super_admin_user
|
client, with_super_admin_user
|
||||||
)
|
)
|
||||||
|
|
||||||
process_model = ProcessModelService().get_process_model(
|
process_model = ProcessModelService.get_process_model(
|
||||||
process_model_id=process_model_identifier
|
process_model_id=process_model_identifier
|
||||||
)
|
)
|
||||||
process_instance = self.create_process_instance_from_process_model(
|
process_instance = self.create_process_instance_from_process_model(
|
||||||
|
@ -81,7 +81,7 @@ class TestMessageInstance(BaseTest):
|
||||||
client, with_super_admin_user
|
client, with_super_admin_user
|
||||||
)
|
)
|
||||||
|
|
||||||
process_model = ProcessModelService().get_process_model(
|
process_model = ProcessModelService.get_process_model(
|
||||||
process_model_id=process_model_identifier
|
process_model_id=process_model_identifier
|
||||||
)
|
)
|
||||||
process_instance = self.create_process_instance_from_process_model(
|
process_instance = self.create_process_instance_from_process_model(
|
||||||
|
@ -127,7 +127,7 @@ class TestMessageInstance(BaseTest):
|
||||||
client, with_super_admin_user
|
client, with_super_admin_user
|
||||||
)
|
)
|
||||||
|
|
||||||
process_model = ProcessModelService().get_process_model(
|
process_model = ProcessModelService.get_process_model(
|
||||||
process_model_id=process_model_identifier
|
process_model_id=process_model_identifier
|
||||||
)
|
)
|
||||||
process_instance = self.create_process_instance_from_process_model(
|
process_instance = self.create_process_instance_from_process_model(
|
||||||
|
@ -174,7 +174,7 @@ class TestMessageInstance(BaseTest):
|
||||||
client, with_super_admin_user
|
client, with_super_admin_user
|
||||||
)
|
)
|
||||||
|
|
||||||
process_model = ProcessModelService().get_process_model(
|
process_model = ProcessModelService.get_process_model(
|
||||||
process_model_id=process_model_identifier
|
process_model_id=process_model_identifier
|
||||||
)
|
)
|
||||||
process_instance = self.create_process_instance_from_process_model(
|
process_instance = self.create_process_instance_from_process_model(
|
||||||
|
|
|
@ -47,7 +47,7 @@ class TestMessageService(BaseTest):
|
||||||
bpmn_file_name="message_sender.bpmn",
|
bpmn_file_name="message_sender.bpmn",
|
||||||
)
|
)
|
||||||
|
|
||||||
process_instance_sender = ProcessInstanceService.create_process_instance(
|
process_instance_sender = ProcessInstanceService.create_process_instance_from_process_model_identifier(
|
||||||
process_model_sender.id,
|
process_model_sender.id,
|
||||||
with_super_admin_user,
|
with_super_admin_user,
|
||||||
)
|
)
|
||||||
|
@ -154,7 +154,7 @@ class TestMessageService(BaseTest):
|
||||||
|
|
||||||
user = self.find_or_create_user()
|
user = self.find_or_create_user()
|
||||||
|
|
||||||
process_instance_sender = ProcessInstanceService.create_process_instance(
|
process_instance_sender = ProcessInstanceService.create_process_instance_from_process_model_identifier(
|
||||||
process_model_sender.id,
|
process_model_sender.id,
|
||||||
user,
|
user,
|
||||||
# process_group_identifier=process_model_sender.process_group_id,
|
# process_group_identifier=process_model_sender.process_group_id,
|
||||||
|
|
|
@ -188,7 +188,7 @@ class TestSpecFileService(BaseTest):
|
||||||
# ,
|
# ,
|
||||||
# process_model_source_directory="call_activity_nested",
|
# process_model_source_directory="call_activity_nested",
|
||||||
# )
|
# )
|
||||||
process_model_info = ProcessModelService().get_process_model(
|
process_model_info = ProcessModelService.get_process_model(
|
||||||
process_model_identifier
|
process_model_identifier
|
||||||
)
|
)
|
||||||
files = SpecFileService.get_files(process_model_info)
|
files = SpecFileService.get_files(process_model_info)
|
||||||
|
|
|
@ -28,7 +28,7 @@ class TestVariousBpmnConstructs(BaseTest):
|
||||||
"timer_intermediate_catch_event",
|
"timer_intermediate_catch_event",
|
||||||
)
|
)
|
||||||
|
|
||||||
process_model = ProcessModelService().get_process_model(
|
process_model = ProcessModelService.get_process_model(
|
||||||
process_model_id=process_model_identifier
|
process_model_id=process_model_identifier
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue