From d04f95a6acb87740a62945661089ac52060086eb Mon Sep 17 00:00:00 2001 From: Jon Herron Date: Tue, 19 Dec 2023 09:45:51 -0500 Subject: [PATCH] Create new json data stores --- .../src/spiffworkflow_backend/data_stores/json.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/spiffworkflow-backend/src/spiffworkflow_backend/data_stores/json.py b/spiffworkflow-backend/src/spiffworkflow_backend/data_stores/json.py index dce1c5740..10a4b3326 100644 --- a/spiffworkflow-backend/src/spiffworkflow_backend/data_stores/json.py +++ b/spiffworkflow-backend/src/spiffworkflow_backend/data_stores/json.py @@ -42,6 +42,19 @@ def _data_store_location_for_task(spiff_task: SpiffTask, name: str) -> str | Non class JSONDataStore(BpmnDataStoreSpecification, DataStoreCRUD): # type: ignore """JSONDataStore.""" + @staticmethod + def create_instance(name: str, identifier: str, location: str, schema: dict[str, Any], description: str | None): + model = JSONDataStoreModel( + name=name, + identifier=identifier, + location=location, + schema=schema, + description=description, + data={}, + ) + db.session.add(model) + db.session.commit() + @staticmethod def existing_data_stores() -> list[dict[str, Any]]: data_stores = []