kuflow-temporal-activity-kuflow 0.4.3.dev0__tar.gz → 0.5.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {kuflow_temporal_activity_kuflow-0.4.3.dev0 → kuflow_temporal_activity_kuflow-0.5.0}/PKG-INFO +2 -2
- kuflow_temporal_activity_kuflow-0.5.0/VERSION +1 -0
- {kuflow_temporal_activity_kuflow-0.4.3.dev0 → kuflow_temporal_activity_kuflow-0.5.0}/kuflow_temporal_activity_kuflow/__init__.py +1 -1
- {kuflow_temporal_activity_kuflow-0.4.3.dev0 → kuflow_temporal_activity_kuflow-0.5.0}/kuflow_temporal_activity_kuflow/converter.py +25 -0
- kuflow_temporal_activity_kuflow-0.5.0/kuflow_temporal_activity_kuflow/kuflow_async_activities.py +50 -0
- {kuflow_temporal_activity_kuflow-0.4.3.dev0 → kuflow_temporal_activity_kuflow-0.5.0}/kuflow_temporal_activity_kuflow/kuflow_sync_activities.py +84 -45
- {kuflow_temporal_activity_kuflow-0.4.3.dev0 → kuflow_temporal_activity_kuflow-0.5.0}/kuflow_temporal_activity_kuflow/models/__init__.py +4 -0
- kuflow_temporal_activity_kuflow-0.5.0/kuflow_temporal_activity_kuflow/models/_models.py +843 -0
- kuflow_temporal_activity_kuflow-0.5.0/kuflow_temporal_activity_kuflow/validation.py +256 -0
- {kuflow_temporal_activity_kuflow-0.4.3.dev0 → kuflow_temporal_activity_kuflow-0.5.0}/pyproject.toml +13 -6
- {kuflow_temporal_activity_kuflow-0.4.3.dev0 → kuflow_temporal_activity_kuflow-0.5.0}/setup.py +2 -2
- kuflow_temporal_activity_kuflow-0.4.3.dev0/VERSION +0 -1
- kuflow_temporal_activity_kuflow-0.4.3.dev0/kuflow_temporal_activity_kuflow/kuflow_async_activities.py +0 -25
- kuflow_temporal_activity_kuflow-0.4.3.dev0/kuflow_temporal_activity_kuflow/models/_models.py +0 -446
- kuflow_temporal_activity_kuflow-0.4.3.dev0/kuflow_temporal_activity_kuflow/validation.py +0 -217
- {kuflow_temporal_activity_kuflow-0.4.3.dev0 → kuflow_temporal_activity_kuflow-0.5.0}/README.md +0 -0
{kuflow_temporal_activity_kuflow-0.4.3.dev0 → kuflow_temporal_activity_kuflow-0.5.0}/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: kuflow-temporal-activity-kuflow
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.5.0
|
|
4
4
|
Summary: KuFlow SDK :: Temporal.io activities to interact with KuFlow
|
|
5
5
|
Home-page: https://kuflow.com/
|
|
6
6
|
License: MIT
|
|
@@ -13,7 +13,7 @@ Classifier: Programming Language :: Python :: 3.8
|
|
|
13
13
|
Classifier: Programming Language :: Python :: 3.9
|
|
14
14
|
Classifier: Programming Language :: Python :: 3.10
|
|
15
15
|
Classifier: Programming Language :: Python :: 3.11
|
|
16
|
-
Requires-Dist: kuflow-temporal-common (>=0.
|
|
16
|
+
Requires-Dist: kuflow-temporal-common (>=0.5.0,<0.6.0)
|
|
17
17
|
Project-URL: Documentation, https://docs.kuflow.com/
|
|
18
18
|
Project-URL: Repository, https://github.com/kuflow/kuflow-sdk-python
|
|
19
19
|
Description-Content-Type: text/markdown
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
0.5.0
|
|
@@ -1,3 +1,28 @@
|
|
|
1
|
+
# coding=utf-8
|
|
2
|
+
#
|
|
3
|
+
# MIT License
|
|
4
|
+
#
|
|
5
|
+
# Copyright (c) 2022 KuFlow
|
|
6
|
+
#
|
|
7
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
8
|
+
# of this software and associated documentation files (the "Software"), to deal
|
|
9
|
+
# in the Software without restriction, including without limitation the rights
|
|
10
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
11
|
+
# copies of the Software, and to permit persons to whom the Software is
|
|
12
|
+
# furnished to do so, subject to the following conditions:
|
|
13
|
+
#
|
|
14
|
+
# The above copyright notice and this permission notice shall be included in all
|
|
15
|
+
# copies or substantial portions of the Software.
|
|
16
|
+
#
|
|
17
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
18
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
19
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
20
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
21
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
22
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
23
|
+
# SOFTWARE.
|
|
24
|
+
#
|
|
25
|
+
|
|
1
26
|
from typing import Any, Optional, Type
|
|
2
27
|
import json
|
|
3
28
|
|
kuflow_temporal_activity_kuflow-0.5.0/kuflow_temporal_activity_kuflow/kuflow_async_activities.py
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# coding=utf-8
|
|
2
|
+
#
|
|
3
|
+
# MIT License
|
|
4
|
+
#
|
|
5
|
+
# Copyright (c) 2022 KuFlow
|
|
6
|
+
#
|
|
7
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
8
|
+
# of this software and associated documentation files (the "Software"), to deal
|
|
9
|
+
# in the Software without restriction, including without limitation the rights
|
|
10
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
11
|
+
# copies of the Software, and to permit persons to whom the Software is
|
|
12
|
+
# furnished to do so, subject to the following conditions:
|
|
13
|
+
#
|
|
14
|
+
# The above copyright notice and this permission notice shall be included in all
|
|
15
|
+
# copies or substantial portions of the Software.
|
|
16
|
+
#
|
|
17
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
18
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
19
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
20
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
21
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
22
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
23
|
+
# SOFTWARE.
|
|
24
|
+
#
|
|
25
|
+
|
|
26
|
+
import base64
|
|
27
|
+
|
|
28
|
+
from temporalio import activity
|
|
29
|
+
from kuflow_rest import KuFlowRestClient
|
|
30
|
+
|
|
31
|
+
from . import models as models_temporal
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
class KuFlowAsyncActivities:
|
|
35
|
+
def __init__(self, kuflow_client: KuFlowRestClient) -> None:
|
|
36
|
+
self._kuflow_client = kuflow_client
|
|
37
|
+
self.activities = [self.create_task_and_wait_finished]
|
|
38
|
+
|
|
39
|
+
@activity.defn
|
|
40
|
+
async def create_task_and_wait_finished(
|
|
41
|
+
self,
|
|
42
|
+
request: models_temporal.CreateTaskRequest,
|
|
43
|
+
) -> None:
|
|
44
|
+
base64_token = base64.b64encode(activity.info().task_token)
|
|
45
|
+
|
|
46
|
+
self._kuflow_client.task.create_task(task=request.task, activity_token=base64_token.decode())
|
|
47
|
+
|
|
48
|
+
# Raise the complete-async error which will complete this function but
|
|
49
|
+
# does not consider the activity complete from the workflow perspective
|
|
50
|
+
activity.raise_complete_async()
|
|
@@ -1,10 +1,34 @@
|
|
|
1
|
+
# coding=utf-8
|
|
2
|
+
#
|
|
3
|
+
# MIT License
|
|
4
|
+
#
|
|
5
|
+
# Copyright (c) 2022 KuFlow
|
|
6
|
+
#
|
|
7
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
8
|
+
# of this software and associated documentation files (the "Software"), to deal
|
|
9
|
+
# in the Software without restriction, including without limitation the rights
|
|
10
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
11
|
+
# copies of the Software, and to permit persons to whom the Software is
|
|
12
|
+
# furnished to do so, subject to the following conditions:
|
|
13
|
+
#
|
|
14
|
+
# The above copyright notice and this permission notice shall be included in all
|
|
15
|
+
# copies or substantial portions of the Software.
|
|
16
|
+
#
|
|
17
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
18
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
19
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
20
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
21
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
22
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
23
|
+
# SOFTWARE.
|
|
24
|
+
#
|
|
25
|
+
|
|
1
26
|
from temporalio import activity
|
|
2
27
|
|
|
3
28
|
from kuflow_rest import KuFlowRestClient, models
|
|
4
|
-
from kuflow_temporal_activity_kuflow import validation
|
|
5
29
|
from kuflow_temporal_common import exceptions
|
|
6
30
|
|
|
7
|
-
from . import models as models_temporal
|
|
31
|
+
from . import models as models_temporal, validation
|
|
8
32
|
|
|
9
33
|
|
|
10
34
|
class KuFlowSyncActivities:
|
|
@@ -38,11 +62,11 @@ class KuFlowSyncActivities:
|
|
|
38
62
|
try:
|
|
39
63
|
validation.validate_retrieve_principal_request(request)
|
|
40
64
|
|
|
41
|
-
principal = self._kuflow_client.principal.retrieve_principal(id=request.
|
|
65
|
+
principal = self._kuflow_client.principal.retrieve_principal(id=request.principal_id)
|
|
42
66
|
|
|
43
67
|
return models_temporal.RetrievePrincipalResponse(principal=principal)
|
|
44
68
|
except Exception as err:
|
|
45
|
-
|
|
69
|
+
raise exceptions.create_application_error(err) from err
|
|
46
70
|
|
|
47
71
|
@activity.defn
|
|
48
72
|
async def find_processes(
|
|
@@ -52,11 +76,11 @@ class KuFlowSyncActivities:
|
|
|
52
76
|
try:
|
|
53
77
|
# Get all non-None properties of the object to avoid overwrite defaults
|
|
54
78
|
non_none_props = {k: v for k, v in vars(request).items() if v is not None}
|
|
55
|
-
|
|
79
|
+
proces_page = self._kuflow_client.process.find_processes(**non_none_props)
|
|
56
80
|
|
|
57
|
-
return models_temporal.FindProcessesResponse(processes=
|
|
81
|
+
return models_temporal.FindProcessesResponse(processes=proces_page)
|
|
58
82
|
except Exception as err:
|
|
59
|
-
|
|
83
|
+
raise exceptions.create_application_error(err) from err
|
|
60
84
|
|
|
61
85
|
@activity.defn
|
|
62
86
|
async def retrieve_process(
|
|
@@ -66,11 +90,11 @@ class KuFlowSyncActivities:
|
|
|
66
90
|
try:
|
|
67
91
|
validation.validate_retrieve_process_request(request)
|
|
68
92
|
|
|
69
|
-
process = self._kuflow_client.process.retrieve_process(id=request.
|
|
93
|
+
process = self._kuflow_client.process.retrieve_process(id=request.process_id)
|
|
70
94
|
|
|
71
95
|
return models_temporal.RetrieveProcessResponse(process=process)
|
|
72
96
|
except Exception as err:
|
|
73
|
-
|
|
97
|
+
raise exceptions.create_application_error(err) from err
|
|
74
98
|
|
|
75
99
|
@activity.defn
|
|
76
100
|
async def save_process_element(
|
|
@@ -81,13 +105,13 @@ class KuFlowSyncActivities:
|
|
|
81
105
|
validation.validate_save_process_element_request(request)
|
|
82
106
|
|
|
83
107
|
command = models.ProcessSaveElementCommand(
|
|
84
|
-
element_definition_code=request.
|
|
108
|
+
element_definition_code=request.element_definition_code, element_values=request.element_values
|
|
85
109
|
)
|
|
86
|
-
process = self._kuflow_client.process.actions_process_save_element(id=request.
|
|
110
|
+
process = self._kuflow_client.process.actions_process_save_element(id=request.process_id, command=command)
|
|
87
111
|
|
|
88
112
|
return models_temporal.SaveProcessElementResponse(process=process)
|
|
89
113
|
except Exception as err:
|
|
90
|
-
|
|
114
|
+
raise exceptions.create_application_error(err) from err
|
|
91
115
|
|
|
92
116
|
@activity.defn
|
|
93
117
|
async def delete_process_element(
|
|
@@ -97,13 +121,13 @@ class KuFlowSyncActivities:
|
|
|
97
121
|
try:
|
|
98
122
|
validation.validate_delete_process_element_request(request)
|
|
99
123
|
|
|
100
|
-
command = models.ProcessDeleteElementCommand(element_definition_code=request.
|
|
124
|
+
command = models.ProcessDeleteElementCommand(element_definition_code=request.element_definition_code)
|
|
101
125
|
|
|
102
|
-
process = self._kuflow_client.process.actions_process_delete_element(id=request.
|
|
126
|
+
process = self._kuflow_client.process.actions_process_delete_element(id=request.process_id, command=command)
|
|
103
127
|
|
|
104
128
|
return models_temporal.DeleteProcessElementResponse(process=process)
|
|
105
129
|
except Exception as err:
|
|
106
|
-
|
|
130
|
+
raise exceptions.create_application_error(err) from err
|
|
107
131
|
|
|
108
132
|
@activity.defn
|
|
109
133
|
async def complete_process(
|
|
@@ -113,11 +137,11 @@ class KuFlowSyncActivities:
|
|
|
113
137
|
try:
|
|
114
138
|
validation.validate_complete_process_request(request)
|
|
115
139
|
|
|
116
|
-
process = self._kuflow_client.process.actions_process_complete(request.
|
|
140
|
+
process = self._kuflow_client.process.actions_process_complete(request.process_id)
|
|
117
141
|
|
|
118
142
|
return models_temporal.CompleteProcessResponse(process=process)
|
|
119
143
|
except Exception as err:
|
|
120
|
-
|
|
144
|
+
raise exceptions.create_application_error(err) from err
|
|
121
145
|
|
|
122
146
|
@activity.defn
|
|
123
147
|
async def change_process_initiator(
|
|
@@ -127,14 +151,14 @@ class KuFlowSyncActivities:
|
|
|
127
151
|
try:
|
|
128
152
|
validation.validate_change_process_initiator_request(request)
|
|
129
153
|
|
|
130
|
-
command = models.ProcessChangeInitiatorCommand(email=request.email, principal_id=request.
|
|
154
|
+
command = models.ProcessChangeInitiatorCommand(email=request.email, principal_id=request.principal_id)
|
|
131
155
|
process = self._kuflow_client.process.actions_process_change_initiator(
|
|
132
|
-
id=request.
|
|
156
|
+
id=request.process_id, command=command
|
|
133
157
|
)
|
|
134
158
|
|
|
135
159
|
return models_temporal.ChangeProcessInitiatorResponse(process=process)
|
|
136
160
|
except Exception as err:
|
|
137
|
-
|
|
161
|
+
raise exceptions.create_application_error(err) from err
|
|
138
162
|
|
|
139
163
|
@activity.defn
|
|
140
164
|
async def find_tasks(
|
|
@@ -144,11 +168,11 @@ class KuFlowSyncActivities:
|
|
|
144
168
|
try:
|
|
145
169
|
# Get all non-None properties of the object to avoid overwrite defaults
|
|
146
170
|
non_none_props = {k: v for k, v in vars(request).items() if v is not None}
|
|
147
|
-
|
|
171
|
+
task_page = self._kuflow_client.task.find_tasks(**non_none_props)
|
|
148
172
|
|
|
149
|
-
return models_temporal.FindTaskResponse(tasks=
|
|
173
|
+
return models_temporal.FindTaskResponse(tasks=task_page)
|
|
150
174
|
except Exception as err:
|
|
151
|
-
|
|
175
|
+
raise exceptions.create_application_error(err) from err
|
|
152
176
|
|
|
153
177
|
@activity.defn
|
|
154
178
|
async def retrieve_task(
|
|
@@ -158,11 +182,11 @@ class KuFlowSyncActivities:
|
|
|
158
182
|
try:
|
|
159
183
|
validation.validate_retrieve_task_request(request)
|
|
160
184
|
|
|
161
|
-
task = self._kuflow_client.task.retrieve_task(id=request.
|
|
185
|
+
task = self._kuflow_client.task.retrieve_task(id=request.task_id)
|
|
162
186
|
|
|
163
187
|
return models_temporal.RetrieveTaskResponse(task=task)
|
|
164
188
|
except Exception as err:
|
|
165
|
-
|
|
189
|
+
raise exceptions.create_application_error(err) from err
|
|
166
190
|
|
|
167
191
|
@activity.defn
|
|
168
192
|
async def create_task(
|
|
@@ -176,7 +200,7 @@ class KuFlowSyncActivities:
|
|
|
176
200
|
|
|
177
201
|
return models_temporal.CreateTaskResponse(task=task)
|
|
178
202
|
except Exception as err:
|
|
179
|
-
|
|
203
|
+
raise exceptions.create_application_error(err) from err
|
|
180
204
|
|
|
181
205
|
@activity.defn
|
|
182
206
|
async def complete_task(
|
|
@@ -186,25 +210,25 @@ class KuFlowSyncActivities:
|
|
|
186
210
|
try:
|
|
187
211
|
validation.validate_complete_task_request(request)
|
|
188
212
|
|
|
189
|
-
task = self._kuflow_client.task.actions_task_complete(id=request.
|
|
213
|
+
task = self._kuflow_client.task.actions_task_complete(id=request.task_id)
|
|
190
214
|
|
|
191
215
|
return models_temporal.CompleteTaskResponse(task=task)
|
|
192
216
|
except Exception as err:
|
|
193
|
-
|
|
217
|
+
raise exceptions.create_application_error(err) from err
|
|
194
218
|
|
|
195
219
|
@activity.defn
|
|
196
220
|
async def claim_task(
|
|
197
221
|
self,
|
|
198
222
|
request: models_temporal.ClaimTaskRequest,
|
|
199
|
-
) -> models_temporal.
|
|
223
|
+
) -> models_temporal.ClaimTaskResponse:
|
|
200
224
|
try:
|
|
201
225
|
validation.validate_claim_task_request(request)
|
|
202
226
|
|
|
203
|
-
task = self._kuflow_client.task.actions_task_claim(id=request.
|
|
227
|
+
task = self._kuflow_client.task.actions_task_claim(id=request.task_id)
|
|
204
228
|
|
|
205
229
|
return models_temporal.ClaimTaskResponse(task=task)
|
|
206
230
|
except Exception as err:
|
|
207
|
-
|
|
231
|
+
raise exceptions.create_application_error(err) from err
|
|
208
232
|
|
|
209
233
|
@activity.defn
|
|
210
234
|
async def assign_task(
|
|
@@ -214,12 +238,12 @@ class KuFlowSyncActivities:
|
|
|
214
238
|
try:
|
|
215
239
|
validation.validate_assign_task_request(request)
|
|
216
240
|
|
|
217
|
-
command = models.TaskAssignCommand(email=request.email, principal_id=request.
|
|
218
|
-
task = self._kuflow_client.task.actions_task_assign(id=request.
|
|
241
|
+
command = models.TaskAssignCommand(email=request.email, principal_id=request.principal_id)
|
|
242
|
+
task = self._kuflow_client.task.actions_task_assign(id=request.task_id, command=command)
|
|
219
243
|
|
|
220
244
|
return models_temporal.AssignTaskResponse(task=task)
|
|
221
245
|
except Exception as err:
|
|
222
|
-
|
|
246
|
+
raise exceptions.create_application_error(err) from err
|
|
223
247
|
|
|
224
248
|
@activity.defn
|
|
225
249
|
async def save_task_element(
|
|
@@ -230,13 +254,13 @@ class KuFlowSyncActivities:
|
|
|
230
254
|
validation.validate_save_task_element_request(request)
|
|
231
255
|
|
|
232
256
|
command = models.TaskSaveElementCommand(
|
|
233
|
-
element_definition_code=request.
|
|
257
|
+
element_definition_code=request.element_definition_code, element_values=request.element_values
|
|
234
258
|
)
|
|
235
|
-
task = self._kuflow_client.task.actions_task_save_element(id=request.
|
|
259
|
+
task = self._kuflow_client.task.actions_task_save_element(id=request.task_id, command=command)
|
|
236
260
|
|
|
237
261
|
return models_temporal.SaveTaskElementResponse(task=task)
|
|
238
262
|
except Exception as err:
|
|
239
|
-
|
|
263
|
+
raise exceptions.create_application_error(err) from err
|
|
240
264
|
|
|
241
265
|
@activity.defn
|
|
242
266
|
async def delete_task_element(
|
|
@@ -246,12 +270,12 @@ class KuFlowSyncActivities:
|
|
|
246
270
|
try:
|
|
247
271
|
validation.validate_delete_task_element_request(request)
|
|
248
272
|
|
|
249
|
-
command = models.TaskDeleteElementCommand(element_definition_code=request.
|
|
250
|
-
task = self._kuflow_client.task.actions_task_delete_element(id=request.
|
|
273
|
+
command = models.TaskDeleteElementCommand(element_definition_code=request.element_definition_code)
|
|
274
|
+
task = self._kuflow_client.task.actions_task_delete_element(id=request.task_id, command=command)
|
|
251
275
|
|
|
252
276
|
return models_temporal.DeleteTaskElementResponse(task=task)
|
|
253
277
|
except Exception as err:
|
|
254
|
-
|
|
278
|
+
raise exceptions.create_application_error(err) from err
|
|
255
279
|
|
|
256
280
|
@activity.defn
|
|
257
281
|
async def delete_task_element_value_document(
|
|
@@ -261,14 +285,29 @@ class KuFlowSyncActivities:
|
|
|
261
285
|
try:
|
|
262
286
|
validation.validate_delete_task_element_value_document_request(request)
|
|
263
287
|
|
|
264
|
-
command = models.TaskDeleteElementValueDocumentCommand(document_id=request.
|
|
288
|
+
command = models.TaskDeleteElementValueDocumentCommand(document_id=request.document_id)
|
|
265
289
|
task = self._kuflow_client.task.actions_task_delete_element_value_document(
|
|
266
|
-
id=request.
|
|
290
|
+
id=request.task_id, command=command
|
|
267
291
|
)
|
|
268
292
|
|
|
269
293
|
return models_temporal.DeleteTaskElementValueDocumentResponse(task=task)
|
|
270
294
|
except Exception as err:
|
|
271
|
-
|
|
295
|
+
raise exceptions.create_application_error(err) from err
|
|
296
|
+
|
|
297
|
+
@activity.defn
|
|
298
|
+
async def save_task_json_forms_value_data(
|
|
299
|
+
self,
|
|
300
|
+
request: models_temporal.SaveTaskJsonFormsValueDataRequest,
|
|
301
|
+
) -> models_temporal.SaveTaskJsonFormsValueDataResponse:
|
|
302
|
+
try:
|
|
303
|
+
validation.validate_save_task_json_forms_value_data(request)
|
|
304
|
+
|
|
305
|
+
command = models.TaskSaveJsonFormsValueDataCommand(data=request.data)
|
|
306
|
+
task = self._kuflow_client.task.actions_task_save_json_forms_value_data(id=request.task_id, command=command)
|
|
307
|
+
|
|
308
|
+
return models_temporal.SaveTaskJsonFormsValueDataResponse(task=task)
|
|
309
|
+
except Exception as err:
|
|
310
|
+
raise exceptions.create_application_error(err) from err
|
|
272
311
|
|
|
273
312
|
@activity.defn
|
|
274
313
|
async def append_task_log(
|
|
@@ -278,8 +317,8 @@ class KuFlowSyncActivities:
|
|
|
278
317
|
try:
|
|
279
318
|
validation.validate_append_task_log_request(request)
|
|
280
319
|
|
|
281
|
-
task = self._kuflow_client.task.actions_task_append_log(id=request.
|
|
320
|
+
task = self._kuflow_client.task.actions_task_append_log(id=request.task_id, log=request.log)
|
|
282
321
|
|
|
283
322
|
return models_temporal.AppendTaskLogResponse(task=task)
|
|
284
323
|
except Exception as err:
|
|
285
|
-
|
|
324
|
+
raise exceptions.create_application_error(err) from err
|
|
@@ -56,6 +56,8 @@ from ._models import (
|
|
|
56
56
|
RetrieveTaskResponse,
|
|
57
57
|
SaveProcessElementRequest,
|
|
58
58
|
SaveProcessElementResponse,
|
|
59
|
+
SaveTaskJsonFormsValueDataRequest,
|
|
60
|
+
SaveTaskJsonFormsValueDataResponse,
|
|
59
61
|
SaveTaskElementRequest,
|
|
60
62
|
SaveTaskElementResponse,
|
|
61
63
|
UserActionWorkflowRequest,
|
|
@@ -97,6 +99,8 @@ __all__ = [
|
|
|
97
99
|
"RetrieveTaskResponse",
|
|
98
100
|
"SaveProcessElementRequest",
|
|
99
101
|
"SaveProcessElementResponse",
|
|
102
|
+
"SaveTaskJsonFormsValueDataRequest",
|
|
103
|
+
"SaveTaskJsonFormsValueDataResponse",
|
|
100
104
|
"SaveTaskElementRequest",
|
|
101
105
|
"SaveTaskElementResponse",
|
|
102
106
|
"UserActionWorkflowRequest",
|