11"""Result of an execution with status and optional error information."""
22
33from enum import Enum
4- from typing import Any , Literal , Optional , Union
4+ from typing import Any , Optional , Union
55
66from pydantic import BaseModel , Field
77
88from uipath .runtime .errors import UiPathErrorContract
99from uipath .runtime .events import UiPathRuntimeEvent , UiPathRuntimeEventType
10+ from uipath .runtime .resumable .trigger import UiPathResumeTrigger
1011
1112
1213class UiPathRuntimeStatus (str , Enum ):
@@ -17,42 +18,6 @@ class UiPathRuntimeStatus(str, Enum):
1718 SUSPENDED = "suspended"
1819
1920
20- class UiPathResumeTriggerType (str , Enum ):
21- """Constants representing different types of resume job triggers in the system."""
22-
23- NONE = "None"
24- QUEUE_ITEM = "QueueItem"
25- JOB = "Job"
26- ACTION = "Task"
27- TIMER = "Timer"
28- INBOX = "Inbox"
29- API = "Api"
30-
31-
32- class UiPathApiTrigger (BaseModel ):
33- """API resume trigger request."""
34-
35- inbox_id : Optional [str ] = Field (default = None , alias = "inboxId" )
36- request : Any = None
37-
38- model_config = {"populate_by_name" : True }
39-
40-
41- class UiPathResumeTrigger (BaseModel ):
42- """Information needed to resume execution."""
43-
44- trigger_type : UiPathResumeTriggerType = Field (
45- default = UiPathResumeTriggerType .API , alias = "triggerType"
46- )
47- item_key : Optional [str ] = Field (default = None , alias = "itemKey" )
48- api_resume : Optional [UiPathApiTrigger ] = Field (default = None , alias = "apiResume" )
49- folder_path : Optional [str ] = Field (default = None , alias = "folderPath" )
50- folder_key : Optional [str ] = Field (default = None , alias = "folderKey" )
51- payload : Optional [Any ] = Field (default = None , alias = "interruptObject" )
52-
53- model_config = {"populate_by_name" : True }
54-
55-
5621class UiPathRuntimeResult (UiPathRuntimeEvent ):
5722 """Result of an execution with status and optional error information."""
5823
@@ -86,16 +51,3 @@ def to_dict(self) -> dict[str, Any]:
8651 result ["error" ] = self .error .model_dump ()
8752
8853 return result
89-
90-
91- class UiPathBreakpointResult (UiPathRuntimeResult ):
92- """Result for execution suspended at a breakpoint."""
93-
94- # Force status to always be SUSPENDED
95- status : UiPathRuntimeStatus = Field (
96- default = UiPathRuntimeStatus .SUSPENDED , frozen = True
97- )
98- breakpoint_node : str # Which node the breakpoint is at
99- breakpoint_type : Literal ["before" , "after" ] # Before or after the node
100- current_state : dict [str , Any ] | Any # Current workflow state at breakpoint
101- next_nodes : list [str ] # Which node(s) will execute next
0 commit comments