mirror of
https://github.com/status-im/spiff-arena.git
synced 2025-01-16 13:15:00 +00:00
configure metadata extration paths appropriately
This commit is contained in:
parent
41aa64832d
commit
3c395ca368
@ -352,10 +352,15 @@ def process_model_create_with_natural_language(
|
|||||||
f"{process_group.id}/{process_model_identifier}"
|
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 = {
|
process_model_attributes = {
|
||||||
"id": qualified_process_model_identifier,
|
"id": qualified_process_model_identifier,
|
||||||
"display_name": process_model_display_name,
|
"display_name": process_model_display_name,
|
||||||
"description": None,
|
"description": None,
|
||||||
|
"metadata_extraction_paths": metadata_extraction_paths,
|
||||||
}
|
}
|
||||||
|
|
||||||
process_model_info = ProcessModelInfo(**process_model_attributes) # type: ignore
|
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"User: {g.user.username} created process model via natural language:"
|
||||||
f" {process_model_info.id}"
|
f" {process_model_info.id}"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# TODO: Create a form json schema and UI schema
|
||||||
|
# TODO: Add report
|
||||||
|
|
||||||
return Response(
|
return Response(
|
||||||
json.dumps(ProcessModelInfoSchema().dump(process_model_info)),
|
json.dumps(ProcessModelInfoSchema().dump(process_model_info)),
|
||||||
status=201,
|
status=201,
|
||||||
|
@ -199,6 +199,11 @@ class TestProcessApi(BaseTest):
|
|||||||
assert response.json is not None
|
assert response.json is not None
|
||||||
assert response.json["id"] == f"{process_group_id}/bug-tracker"
|
assert response.json["id"] == f"{process_group_id}/bug-tracker"
|
||||||
assert response.json["display_name"] == "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(
|
def test_primary_process_id_updates_via_xml(
|
||||||
self,
|
self,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user