diff --git a/spiffworkflow-backend/src/spiffworkflow_backend/routes/process_models_controller.py b/spiffworkflow-backend/src/spiffworkflow_backend/routes/process_models_controller.py index 6276eda5..a1c750cd 100644 --- a/spiffworkflow-backend/src/spiffworkflow_backend/routes/process_models_controller.py +++ b/spiffworkflow-backend/src/spiffworkflow_backend/routes/process_models_controller.py @@ -352,10 +352,15 @@ def process_model_create_with_natural_language( f"{process_group.id}/{process_model_identifier}" ) + metadata_extraction_paths = [] + for column in columns: + metadata_extraction_paths.append({"key": column, "path": column}) + process_model_attributes = { "id": qualified_process_model_identifier, "display_name": process_model_display_name, "description": None, + "metadata_extraction_paths": metadata_extraction_paths, } process_model_info = ProcessModelInfo(**process_model_attributes) # type: ignore @@ -371,6 +376,10 @@ def process_model_create_with_natural_language( f"User: {g.user.username} created process model via natural language:" f" {process_model_info.id}" ) + + # TODO: Create a form json schema and UI schema + # TODO: Add report + return Response( json.dumps(ProcessModelInfoSchema().dump(process_model_info)), status=201, diff --git a/spiffworkflow-backend/tests/spiffworkflow_backend/integration/test_process_api.py b/spiffworkflow-backend/tests/spiffworkflow_backend/integration/test_process_api.py index a7179966..809063cb 100644 --- a/spiffworkflow-backend/tests/spiffworkflow_backend/integration/test_process_api.py +++ b/spiffworkflow-backend/tests/spiffworkflow_backend/integration/test_process_api.py @@ -199,6 +199,11 @@ class TestProcessApi(BaseTest): assert response.json is not None assert response.json["id"] == f"{process_group_id}/bug-tracker" assert response.json["display_name"] == "Bug Tracker" + assert response.json["metadata_extraction_paths"] == [ + {"key": "summary", "path": "summary"}, + {"key": "description", "path": "description"}, + {"key": "priority", "path": "priority"}, + ] def test_primary_process_id_updates_via_xml( self,