configure metadata extration paths appropriately

This commit is contained in:
burnettk 2022-12-30 22:49:35 -05:00
parent 41aa64832d
commit 3c395ca368
2 changed files with 14 additions and 0 deletions

View File

@ -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,

View File

@ -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,