Skip to content

Commit 9d08d3b

Browse files
Improve and add more handling workflow uncompleted (#40)
1 parent 0e39ed2 commit 9d08d3b

21 files changed

+612
-19
lines changed

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,13 @@ See [contribution guide](CONTRIBUTION.md)
3636
- [x] Skip timer API for testing/operation
3737
- [x] Decider trigger type: any command combination
3838

39+
## 1.2
40+
- [x] API improvements to reduce boilerplate code
41+
42+
## 1.3
43+
- [x] Support failing workflow with results
44+
- [x] Improve workflow uncompleted error return(canceled, failed, timeout, terminated)
45+
3946
## Future
4047
- [ ] Decider trigger type: AnyCommandClosed
4148
- [ ] WaitForMoreResults in StateDecision

gen/iwfidl/.openapi-generator/FILES

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ docs/StateMovement.md
3636
docs/TimerCommand.md
3737
docs/TimerResult.md
3838
docs/TimerStatus.md
39+
docs/WorkflowErrorType.md
3940
docs/WorkflowGetDataObjectsRequest.md
4041
docs/WorkflowGetDataObjectsResponse.md
4142
docs/WorkflowGetRequest.md
@@ -94,6 +95,7 @@ model_state_movement.go
9495
model_timer_command.go
9596
model_timer_result.go
9697
model_timer_status.go
98+
model_workflow_error_type.go
9799
model_workflow_get_data_objects_request.go
98100
model_workflow_get_data_objects_response.go
99101
model_workflow_get_request.go

gen/iwfidl/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ Class | Method | HTTP request | Description
123123
- [TimerCommand](docs/TimerCommand.md)
124124
- [TimerResult](docs/TimerResult.md)
125125
- [TimerStatus](docs/TimerStatus.md)
126+
- [WorkflowErrorType](docs/WorkflowErrorType.md)
126127
- [WorkflowGetDataObjectsRequest](docs/WorkflowGetDataObjectsRequest.md)
127128
- [WorkflowGetDataObjectsResponse](docs/WorkflowGetDataObjectsResponse.md)
128129
- [WorkflowGetRequest](docs/WorkflowGetRequest.md)

gen/iwfidl/api/openapi.yaml

Lines changed: 31 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -333,11 +333,12 @@ components:
333333
maximumAttempts: 7
334334
initialIntervalSeconds: 5
335335
maximumIntervalSeconds: 2
336-
backoffCoefficient: 5.637376656633329
336+
backoffCoefficient: 5.637377
337337
properties:
338338
initialIntervalSeconds:
339339
type: integer
340340
backoffCoefficient:
341+
format: float
341342
type: number
342343
maximumIntervalSeconds:
343344
type: integer
@@ -357,14 +358,14 @@ components:
357358
maximumAttempts: 7
358359
initialIntervalSeconds: 5
359360
maximumIntervalSeconds: 2
360-
backoffCoefficient: 5.637376656633329
361+
backoffCoefficient: 5.637377
361362
decideApiTimeoutSeconds: 1
362363
startApiTimeoutSeconds: 6
363364
startApiRetryPolicy:
364365
maximumAttempts: 7
365366
initialIntervalSeconds: 5
366367
maximumIntervalSeconds: 2
367-
backoffCoefficient: 5.637376656633329
368+
backoffCoefficient: 5.637377
368369
dataObjectsLoadingPolicy:
369370
partialLoadingKeys:
370371
- partialLoadingKeys
@@ -392,7 +393,7 @@ components:
392393
maximumAttempts: 7
393394
initialIntervalSeconds: 5
394395
maximumIntervalSeconds: 2
395-
backoffCoefficient: 5.637376656633329
396+
backoffCoefficient: 5.637377
396397
searchAttributes:
397398
- stringValue: stringValue
398399
valueType: null
@@ -492,14 +493,14 @@ components:
492493
maximumAttempts: 7
493494
initialIntervalSeconds: 5
494495
maximumIntervalSeconds: 2
495-
backoffCoefficient: 5.637376656633329
496+
backoffCoefficient: 5.637377
496497
decideApiTimeoutSeconds: 1
497498
startApiTimeoutSeconds: 6
498499
startApiRetryPolicy:
499500
maximumAttempts: 7
500501
initialIntervalSeconds: 5
501502
maximumIntervalSeconds: 2
502-
backoffCoefficient: 5.637376656633329
503+
backoffCoefficient: 5.637377
503504
dataObjectsLoadingPolicy:
504505
partialLoadingKeys:
505506
- partialLoadingKeys
@@ -511,7 +512,7 @@ components:
511512
maximumAttempts: 7
512513
initialIntervalSeconds: 5
513514
maximumIntervalSeconds: 2
514-
backoffCoefficient: 5.637376656633329
515+
backoffCoefficient: 5.637377
515516
searchAttributes:
516517
- stringValue: stringValue
517518
valueType: null
@@ -717,6 +718,8 @@ components:
717718
WorkflowGetResponse:
718719
example:
719720
workflowStatus: null
721+
errorType: null
722+
errorMessage: errorMessage
720723
workflowRunId: workflowRunId
721724
results:
722725
- completedStateOutput:
@@ -738,10 +741,21 @@ components:
738741
items:
739742
$ref: '#/components/schemas/StateCompletionOutput'
740743
type: array
744+
errorType:
745+
$ref: '#/components/schemas/WorkflowErrorType'
746+
errorMessage:
747+
type: string
741748
required:
742749
- workflowRunId
743750
- workflowStatus
744751
type: object
752+
WorkflowErrorType:
753+
enum:
754+
- STATE_DECISION_FAILING_WORKFLOW_ERROR_TYPE
755+
- STATE_API_FAIL_MAX_OUT_RETRY_ERROR_TYPE
756+
- INVALID_USER_WORKFLOW_CODE_ERROR_TYPE
757+
- SERVER_INTERNAL_ERROR_TYPE
758+
type: string
745759
WorkflowStatus:
746760
enum:
747761
- RUNNING
@@ -1213,14 +1227,14 @@ components:
12131227
maximumAttempts: 7
12141228
initialIntervalSeconds: 5
12151229
maximumIntervalSeconds: 2
1216-
backoffCoefficient: 5.637376656633329
1230+
backoffCoefficient: 5.637377
12171231
decideApiTimeoutSeconds: 1
12181232
startApiTimeoutSeconds: 6
12191233
startApiRetryPolicy:
12201234
maximumAttempts: 7
12211235
initialIntervalSeconds: 5
12221236
maximumIntervalSeconds: 2
1223-
backoffCoefficient: 5.637376656633329
1237+
backoffCoefficient: 5.637377
12241238
dataObjectsLoadingPolicy:
12251239
partialLoadingKeys:
12261240
- partialLoadingKeys
@@ -1242,14 +1256,14 @@ components:
12421256
maximumAttempts: 7
12431257
initialIntervalSeconds: 5
12441258
maximumIntervalSeconds: 2
1245-
backoffCoefficient: 5.637376656633329
1259+
backoffCoefficient: 5.637377
12461260
decideApiTimeoutSeconds: 1
12471261
startApiTimeoutSeconds: 6
12481262
startApiRetryPolicy:
12491263
maximumAttempts: 7
12501264
initialIntervalSeconds: 5
12511265
maximumIntervalSeconds: 2
1252-
backoffCoefficient: 5.637376656633329
1266+
backoffCoefficient: 5.637377
12531267
dataObjectsLoadingPolicy:
12541268
partialLoadingKeys:
12551269
- partialLoadingKeys
@@ -1325,14 +1339,14 @@ components:
13251339
maximumAttempts: 7
13261340
initialIntervalSeconds: 5
13271341
maximumIntervalSeconds: 2
1328-
backoffCoefficient: 5.637376656633329
1342+
backoffCoefficient: 5.637377
13291343
decideApiTimeoutSeconds: 1
13301344
startApiTimeoutSeconds: 6
13311345
startApiRetryPolicy:
13321346
maximumAttempts: 7
13331347
initialIntervalSeconds: 5
13341348
maximumIntervalSeconds: 2
1335-
backoffCoefficient: 5.637376656633329
1349+
backoffCoefficient: 5.637377
13361350
dataObjectsLoadingPolicy:
13371351
partialLoadingKeys:
13381352
- partialLoadingKeys
@@ -1354,14 +1368,14 @@ components:
13541368
maximumAttempts: 7
13551369
initialIntervalSeconds: 5
13561370
maximumIntervalSeconds: 2
1357-
backoffCoefficient: 5.637376656633329
1371+
backoffCoefficient: 5.637377
13581372
decideApiTimeoutSeconds: 1
13591373
startApiTimeoutSeconds: 6
13601374
startApiRetryPolicy:
13611375
maximumAttempts: 7
13621376
initialIntervalSeconds: 5
13631377
maximumIntervalSeconds: 2
1364-
backoffCoefficient: 5.637376656633329
1378+
backoffCoefficient: 5.637377
13651379
dataObjectsLoadingPolicy:
13661380
partialLoadingKeys:
13671381
- partialLoadingKeys
@@ -1391,14 +1405,14 @@ components:
13911405
maximumAttempts: 7
13921406
initialIntervalSeconds: 5
13931407
maximumIntervalSeconds: 2
1394-
backoffCoefficient: 5.637376656633329
1408+
backoffCoefficient: 5.637377
13951409
decideApiTimeoutSeconds: 1
13961410
startApiTimeoutSeconds: 6
13971411
startApiRetryPolicy:
13981412
maximumAttempts: 7
13991413
initialIntervalSeconds: 5
14001414
maximumIntervalSeconds: 2
1401-
backoffCoefficient: 5.637376656633329
1415+
backoffCoefficient: 5.637377
14021416
dataObjectsLoadingPolicy:
14031417
partialLoadingKeys:
14041418
- partialLoadingKeys
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# WorkflowErrorType
2+
3+
## Enum
4+
5+
6+
* `STATE_DECISION_FAILING_WORKFLOW_ERROR_TYPE` (value: `"STATE_DECISION_FAILING_WORKFLOW_ERROR_TYPE"`)
7+
8+
* `STATE_API_FAIL_MAX_OUT_RETRY_ERROR_TYPE` (value: `"STATE_API_FAIL_MAX_OUT_RETRY_ERROR_TYPE"`)
9+
10+
* `INVALID_USER_WORKFLOW_CODE_ERROR_TYPE` (value: `"INVALID_USER_WORKFLOW_CODE_ERROR_TYPE"`)
11+
12+
* `SERVER_INTERNAL_ERROR_TYPE` (value: `"SERVER_INTERNAL_ERROR_TYPE"`)
13+
14+
15+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
16+
17+

gen/iwfidl/docs/WorkflowGetResponse.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ Name | Type | Description | Notes
77
**WorkflowRunId** | **string** | |
88
**WorkflowStatus** | [**WorkflowStatus**](WorkflowStatus.md) | |
99
**Results** | Pointer to [**[]StateCompletionOutput**](StateCompletionOutput.md) | | [optional]
10+
**ErrorType** | Pointer to [**WorkflowErrorType**](WorkflowErrorType.md) | | [optional]
11+
**ErrorMessage** | Pointer to **string** | | [optional]
1012

1113
## Methods
1214

@@ -92,6 +94,56 @@ SetResults sets Results field to given value.
9294

9395
HasResults returns a boolean if a field has been set.
9496

97+
### GetErrorType
98+
99+
`func (o *WorkflowGetResponse) GetErrorType() WorkflowErrorType`
100+
101+
GetErrorType returns the ErrorType field if non-nil, zero value otherwise.
102+
103+
### GetErrorTypeOk
104+
105+
`func (o *WorkflowGetResponse) GetErrorTypeOk() (*WorkflowErrorType, bool)`
106+
107+
GetErrorTypeOk returns a tuple with the ErrorType field if it's non-nil, zero value otherwise
108+
and a boolean to check if the value has been set.
109+
110+
### SetErrorType
111+
112+
`func (o *WorkflowGetResponse) SetErrorType(v WorkflowErrorType)`
113+
114+
SetErrorType sets ErrorType field to given value.
115+
116+
### HasErrorType
117+
118+
`func (o *WorkflowGetResponse) HasErrorType() bool`
119+
120+
HasErrorType returns a boolean if a field has been set.
121+
122+
### GetErrorMessage
123+
124+
`func (o *WorkflowGetResponse) GetErrorMessage() string`
125+
126+
GetErrorMessage returns the ErrorMessage field if non-nil, zero value otherwise.
127+
128+
### GetErrorMessageOk
129+
130+
`func (o *WorkflowGetResponse) GetErrorMessageOk() (*string, bool)`
131+
132+
GetErrorMessageOk returns a tuple with the ErrorMessage field if it's non-nil, zero value otherwise
133+
and a boolean to check if the value has been set.
134+
135+
### SetErrorMessage
136+
137+
`func (o *WorkflowGetResponse) SetErrorMessage(v string)`
138+
139+
SetErrorMessage sets ErrorMessage field to given value.
140+
141+
### HasErrorMessage
142+
143+
`func (o *WorkflowGetResponse) HasErrorMessage() bool`
144+
145+
HasErrorMessage returns a boolean if a field has been set.
146+
95147

96148
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
97149

0 commit comments

Comments
 (0)