diff --git a/spiffworkflow-backend/tests/data/subprocess_with_manual_task/subprocess_with_manual_task.bpmn b/spiffworkflow-backend/tests/data/subprocess_with_manual_task/subprocess_with_manual_task.bpmn new file mode 100644 index 000000000..442f7a923 --- /dev/null +++ b/spiffworkflow-backend/tests/data/subprocess_with_manual_task/subprocess_with_manual_task.bpmn @@ -0,0 +1,81 @@ + + + + + Flow_17db3yp + + + + Flow_12pkbxb + + + + + This is an example **Manual Task**. A **Manual Task** is designed to allow someone to complete a task outside of the system and then report back that it is complete. You can click the *Continue* button to proceed. When you are done running this process, you can edit the **Process Model** to include a: + + * **Script Task** - write a short snippet of python code to update some data + * **User Task** - generate a form that collects information from a user + * **Service Task** - communicate with an external API to fetch or update some data. + +You can also change the text you are reading here by updating the *Instructions* on this example manual task. + + Flow_17db3yp + Flow_12pkbxb + + Flow_1j4qlo8 + + + + Flow_0rqseh5 + + + + Flow_1j4qlo8 + Flow_0rqseh5 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/spiffworkflow-backend/tests/spiffworkflow_backend/unit/test_process_instance_processor.py b/spiffworkflow-backend/tests/spiffworkflow_backend/unit/test_process_instance_processor.py index 55c80c969..1cea4d373 100644 --- a/spiffworkflow-backend/tests/spiffworkflow_backend/unit/test_process_instance_processor.py +++ b/spiffworkflow-backend/tests/spiffworkflow_backend/unit/test_process_instance_processor.py @@ -1136,6 +1136,31 @@ def test_simple_call_activity_chain( processor.do_engine_steps(save=True, execution_strategy_name="greedy") assert process_instance.status == ProcessInstanceStatus.complete.value + def test_can_terminate_instance_with_subprocess( + self, + app: Flask, + client: FlaskClient, + with_db_and_bpmn_file_cleanup: None, + ) -> None: + self.create_process_group("test_group", "test_group") + initiator_user = self.find_or_create_user("initiator_user") + finance_user_three = self.find_or_create_user("testuser3") + assert initiator_user.principal is not None + assert finance_user_three.principal is not None + AuthorizationService.import_permissions_from_yaml_file() + + finance_group = GroupModel.query.filter_by(identifier="Finance Team").first() + assert finance_group is not None + + process_model = load_test_spec( + process_model_id="test_group/subprocess_with_manual_task", + process_model_source_directory="subprocess_with_manual_task", + ) + process_instance = self.create_process_instance_from_process_model(process_model=process_model, user=initiator_user) + processor = ProcessInstanceProcessor(process_instance) + processor.do_engine_steps(save=True, execution_strategy_name="greedy") + processor.terminate() + # # To test processing times with multiinstance subprocesses # def test_large_multiinstance( # self,