File tree Expand file tree Collapse file tree 3 files changed +31
-1
lines changed
Expand file tree Collapse file tree 3 files changed +31
-1
lines changed Original file line number Diff line number Diff line change 55from .abort_and_show_error import AbortAndShowErrorAction
66from .base import ActionNames
77from .dummy import DummyAction
8+ from .start_workflow import StartWorkflowAction
89
9- ActionUnion = Union [AbortAndShowErrorAction , DummyAction ]
10+ ActionUnion = Union [AbortAndShowErrorAction , DummyAction , StartWorkflowAction ]
1011Action = Annotated [ActionUnion , Field (discriminator = "name" )]
1112
1213__all__ = [
1516 "DummyAction" ,
1617 "AbortAndShowErrorAction" ,
1718 "ActionUnion" ,
19+ "StartWorkflowAction" ,
1820]
Original file line number Diff line number Diff line change 66class ActionNames (str , Enum ):
77 ABORT_AND_SHOW_ERROR = "abort_and_show_error"
88 DUMMY = "dummy"
9+ START_WORKFLOW = "start_workflow"
910
1011
1112class BaseAction (BaseModel ):
Original file line number Diff line number Diff line change 1+ from typing import Literal
2+
3+ from pydantic import BaseModel , Field
4+
5+ from .base import ActionNames , BaseAction
6+
7+
8+ class TaskParameter (BaseModel ):
9+ task_id : str = Field (..., description = "Identifier for the task this parameter belongs to" )
10+ name : str = Field (..., description = "Name of the parameter" )
11+ value : str = Field (..., description = "Value of the parameter" )
12+
13+
14+ class StartWorkflowAction (BaseAction ):
15+ name : Literal [ActionNames .START_WORKFLOW ] = ActionNames .START_WORKFLOW
16+ template_id : str = Field (..., description = "ID of the workflow template to start" )
17+ cdb_project_id : str | None = Field (
18+ default = None , description = "ID of the project in which the workflow should be started"
19+ )
20+ title : str = Field (..., description = "Title of the workflow" )
21+ attachment_ids : list [str ] = Field (
22+ default_factory = list , description = "List of cdb_object_ids to attach to the workflow"
23+ )
24+ global_briefcase_object_ids : list [str ] = Field (
25+ default_factory = list , description = "List of cdb_object_ids to attach to the global briefcase"
26+ )
27+ task_parameters : list [TaskParameter ] = Field (default_factory = list , description = "List of task parameters" )
You can’t perform that action at this time.
0 commit comments