Adding workflow management
I
This commit is contained in:
26
src/components/workflows/WorkflowsApp.py
Normal file
26
src/components/workflows/WorkflowsApp.py
Normal file
@@ -0,0 +1,26 @@
|
||||
import json
|
||||
import logging
|
||||
|
||||
from fasthtml.fastapp import fast_app
|
||||
|
||||
from components.workflows.constants import Routes
|
||||
from core.instance_manager import InstanceManager, debug_session
|
||||
|
||||
logger = logging.getLogger("WorkflowsApp")
|
||||
|
||||
repositories_app, rt = fast_app()
|
||||
|
||||
|
||||
@rt(Routes.AddWorkflow)
|
||||
def get(session, _id: str):
|
||||
logger.debug(f"Entering {Routes.AddWorkflow} with args {debug_session(session)}, {_id=}")
|
||||
instance = InstanceManager.get(session, _id)
|
||||
return instance.request_new_workflow()
|
||||
|
||||
|
||||
@rt(Routes.AddWorkflow)
|
||||
def post(session, _id: str, tab_id: str, form_id: str, name: str, tab_boundaries: str):
|
||||
logger.debug(
|
||||
f"Entering {Routes.AddWorkflow} with args {debug_session(session)}, {_id=}, {tab_id=}, {form_id=}, {name=}, {tab_boundaries=}")
|
||||
instance = InstanceManager.get(session, _id)
|
||||
return instance.add_new_workflow(tab_id, form_id, name, json.loads(tab_boundaries))
|
||||
Reference in New Issue
Block a user