configure metadata extration paths appropriately
This commit is contained in:
parent
7bb2a67ce1
commit
65c194f984
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue