Skip to content

Commit

Permalink
Improve and add more handling workflow uncompleted (#40)
Browse files Browse the repository at this point in the history
  • Loading branch information
longquanzheng committed Feb 6, 2023
1 parent 0e39ed2 commit 9d08d3b
Show file tree
Hide file tree
Showing 21 changed files with 612 additions and 19 deletions.
7 changes: 7 additions & 0 deletions README.md
Expand Up @@ -36,6 +36,13 @@ See [contribution guide](CONTRIBUTION.md)
- [x] Skip timer API for testing/operation
- [x] Decider trigger type: any command combination

## 1.2
- [x] API improvements to reduce boilerplate code

## 1.3
- [x] Support failing workflow with results
- [x] Improve workflow uncompleted error return(canceled, failed, timeout, terminated)

## Future
- [ ] Decider trigger type: AnyCommandClosed
- [ ] WaitForMoreResults in StateDecision
Expand Down
2 changes: 2 additions & 0 deletions gen/iwfidl/.openapi-generator/FILES
Expand Up @@ -36,6 +36,7 @@ docs/StateMovement.md
docs/TimerCommand.md
docs/TimerResult.md
docs/TimerStatus.md
docs/WorkflowErrorType.md
docs/WorkflowGetDataObjectsRequest.md
docs/WorkflowGetDataObjectsResponse.md
docs/WorkflowGetRequest.md
Expand Down Expand Up @@ -94,6 +95,7 @@ model_state_movement.go
model_timer_command.go
model_timer_result.go
model_timer_status.go
model_workflow_error_type.go
model_workflow_get_data_objects_request.go
model_workflow_get_data_objects_response.go
model_workflow_get_request.go
Expand Down
1 change: 1 addition & 0 deletions gen/iwfidl/README.md
Expand Up @@ -123,6 +123,7 @@ Class | Method | HTTP request | Description
- [TimerCommand](docs/TimerCommand.md)
- [TimerResult](docs/TimerResult.md)
- [TimerStatus](docs/TimerStatus.md)
- [WorkflowErrorType](docs/WorkflowErrorType.md)
- [WorkflowGetDataObjectsRequest](docs/WorkflowGetDataObjectsRequest.md)
- [WorkflowGetDataObjectsResponse](docs/WorkflowGetDataObjectsResponse.md)
- [WorkflowGetRequest](docs/WorkflowGetRequest.md)
Expand Down
48 changes: 31 additions & 17 deletions gen/iwfidl/api/openapi.yaml
Expand Up @@ -333,11 +333,12 @@ components:
maximumAttempts: 7
initialIntervalSeconds: 5
maximumIntervalSeconds: 2
backoffCoefficient: 5.637376656633329
backoffCoefficient: 5.637377
properties:
initialIntervalSeconds:
type: integer
backoffCoefficient:
format: float
type: number
maximumIntervalSeconds:
type: integer
Expand All @@ -357,14 +358,14 @@ components:
maximumAttempts: 7
initialIntervalSeconds: 5
maximumIntervalSeconds: 2
backoffCoefficient: 5.637376656633329
backoffCoefficient: 5.637377
decideApiTimeoutSeconds: 1
startApiTimeoutSeconds: 6
startApiRetryPolicy:
maximumAttempts: 7
initialIntervalSeconds: 5
maximumIntervalSeconds: 2
backoffCoefficient: 5.637376656633329
backoffCoefficient: 5.637377
dataObjectsLoadingPolicy:
partialLoadingKeys:
- partialLoadingKeys
Expand Down Expand Up @@ -392,7 +393,7 @@ components:
maximumAttempts: 7
initialIntervalSeconds: 5
maximumIntervalSeconds: 2
backoffCoefficient: 5.637376656633329
backoffCoefficient: 5.637377
searchAttributes:
- stringValue: stringValue
valueType: null
Expand Down Expand Up @@ -492,14 +493,14 @@ components:
maximumAttempts: 7
initialIntervalSeconds: 5
maximumIntervalSeconds: 2
backoffCoefficient: 5.637376656633329
backoffCoefficient: 5.637377
decideApiTimeoutSeconds: 1
startApiTimeoutSeconds: 6
startApiRetryPolicy:
maximumAttempts: 7
initialIntervalSeconds: 5
maximumIntervalSeconds: 2
backoffCoefficient: 5.637376656633329
backoffCoefficient: 5.637377
dataObjectsLoadingPolicy:
partialLoadingKeys:
- partialLoadingKeys
Expand All @@ -511,7 +512,7 @@ components:
maximumAttempts: 7
initialIntervalSeconds: 5
maximumIntervalSeconds: 2
backoffCoefficient: 5.637376656633329
backoffCoefficient: 5.637377
searchAttributes:
- stringValue: stringValue
valueType: null
Expand Down Expand Up @@ -717,6 +718,8 @@ components:
WorkflowGetResponse:
example:
workflowStatus: null
errorType: null
errorMessage: errorMessage
workflowRunId: workflowRunId
results:
- completedStateOutput:
Expand All @@ -738,10 +741,21 @@ components:
items:
$ref: '#/components/schemas/StateCompletionOutput'
type: array
errorType:
$ref: '#/components/schemas/WorkflowErrorType'
errorMessage:
type: string
required:
- workflowRunId
- workflowStatus
type: object
WorkflowErrorType:
enum:
- STATE_DECISION_FAILING_WORKFLOW_ERROR_TYPE
- STATE_API_FAIL_MAX_OUT_RETRY_ERROR_TYPE
- INVALID_USER_WORKFLOW_CODE_ERROR_TYPE
- SERVER_INTERNAL_ERROR_TYPE
type: string
WorkflowStatus:
enum:
- RUNNING
Expand Down Expand Up @@ -1213,14 +1227,14 @@ components:
maximumAttempts: 7
initialIntervalSeconds: 5
maximumIntervalSeconds: 2
backoffCoefficient: 5.637376656633329
backoffCoefficient: 5.637377
decideApiTimeoutSeconds: 1
startApiTimeoutSeconds: 6
startApiRetryPolicy:
maximumAttempts: 7
initialIntervalSeconds: 5
maximumIntervalSeconds: 2
backoffCoefficient: 5.637376656633329
backoffCoefficient: 5.637377
dataObjectsLoadingPolicy:
partialLoadingKeys:
- partialLoadingKeys
Expand All @@ -1242,14 +1256,14 @@ components:
maximumAttempts: 7
initialIntervalSeconds: 5
maximumIntervalSeconds: 2
backoffCoefficient: 5.637376656633329
backoffCoefficient: 5.637377
decideApiTimeoutSeconds: 1
startApiTimeoutSeconds: 6
startApiRetryPolicy:
maximumAttempts: 7
initialIntervalSeconds: 5
maximumIntervalSeconds: 2
backoffCoefficient: 5.637376656633329
backoffCoefficient: 5.637377
dataObjectsLoadingPolicy:
partialLoadingKeys:
- partialLoadingKeys
Expand Down Expand Up @@ -1325,14 +1339,14 @@ components:
maximumAttempts: 7
initialIntervalSeconds: 5
maximumIntervalSeconds: 2
backoffCoefficient: 5.637376656633329
backoffCoefficient: 5.637377
decideApiTimeoutSeconds: 1
startApiTimeoutSeconds: 6
startApiRetryPolicy:
maximumAttempts: 7
initialIntervalSeconds: 5
maximumIntervalSeconds: 2
backoffCoefficient: 5.637376656633329
backoffCoefficient: 5.637377
dataObjectsLoadingPolicy:
partialLoadingKeys:
- partialLoadingKeys
Expand All @@ -1354,14 +1368,14 @@ components:
maximumAttempts: 7
initialIntervalSeconds: 5
maximumIntervalSeconds: 2
backoffCoefficient: 5.637376656633329
backoffCoefficient: 5.637377
decideApiTimeoutSeconds: 1
startApiTimeoutSeconds: 6
startApiRetryPolicy:
maximumAttempts: 7
initialIntervalSeconds: 5
maximumIntervalSeconds: 2
backoffCoefficient: 5.637376656633329
backoffCoefficient: 5.637377
dataObjectsLoadingPolicy:
partialLoadingKeys:
- partialLoadingKeys
Expand Down Expand Up @@ -1391,14 +1405,14 @@ components:
maximumAttempts: 7
initialIntervalSeconds: 5
maximumIntervalSeconds: 2
backoffCoefficient: 5.637376656633329
backoffCoefficient: 5.637377
decideApiTimeoutSeconds: 1
startApiTimeoutSeconds: 6
startApiRetryPolicy:
maximumAttempts: 7
initialIntervalSeconds: 5
maximumIntervalSeconds: 2
backoffCoefficient: 5.637376656633329
backoffCoefficient: 5.637377
dataObjectsLoadingPolicy:
partialLoadingKeys:
- partialLoadingKeys
Expand Down
17 changes: 17 additions & 0 deletions gen/iwfidl/docs/WorkflowErrorType.md
@@ -0,0 +1,17 @@
# WorkflowErrorType

## Enum


* `STATE_DECISION_FAILING_WORKFLOW_ERROR_TYPE` (value: `"STATE_DECISION_FAILING_WORKFLOW_ERROR_TYPE"`)

* `STATE_API_FAIL_MAX_OUT_RETRY_ERROR_TYPE` (value: `"STATE_API_FAIL_MAX_OUT_RETRY_ERROR_TYPE"`)

* `INVALID_USER_WORKFLOW_CODE_ERROR_TYPE` (value: `"INVALID_USER_WORKFLOW_CODE_ERROR_TYPE"`)

* `SERVER_INTERNAL_ERROR_TYPE` (value: `"SERVER_INTERNAL_ERROR_TYPE"`)


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


52 changes: 52 additions & 0 deletions gen/iwfidl/docs/WorkflowGetResponse.md
Expand Up @@ -7,6 +7,8 @@ Name | Type | Description | Notes
**WorkflowRunId** | **string** | |
**WorkflowStatus** | [**WorkflowStatus**](WorkflowStatus.md) | |
**Results** | Pointer to [**[]StateCompletionOutput**](StateCompletionOutput.md) | | [optional]
**ErrorType** | Pointer to [**WorkflowErrorType**](WorkflowErrorType.md) | | [optional]
**ErrorMessage** | Pointer to **string** | | [optional]

## Methods

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

HasResults returns a boolean if a field has been set.

### GetErrorType

`func (o *WorkflowGetResponse) GetErrorType() WorkflowErrorType`

GetErrorType returns the ErrorType field if non-nil, zero value otherwise.

### GetErrorTypeOk

`func (o *WorkflowGetResponse) GetErrorTypeOk() (*WorkflowErrorType, bool)`

GetErrorTypeOk returns a tuple with the ErrorType field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.

### SetErrorType

`func (o *WorkflowGetResponse) SetErrorType(v WorkflowErrorType)`

SetErrorType sets ErrorType field to given value.

### HasErrorType

`func (o *WorkflowGetResponse) HasErrorType() bool`

HasErrorType returns a boolean if a field has been set.

### GetErrorMessage

`func (o *WorkflowGetResponse) GetErrorMessage() string`

GetErrorMessage returns the ErrorMessage field if non-nil, zero value otherwise.

### GetErrorMessageOk

`func (o *WorkflowGetResponse) GetErrorMessageOk() (*string, bool)`

GetErrorMessageOk returns a tuple with the ErrorMessage field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.

### SetErrorMessage

`func (o *WorkflowGetResponse) SetErrorMessage(v string)`

SetErrorMessage sets ErrorMessage field to given value.

### HasErrorMessage

`func (o *WorkflowGetResponse) HasErrorMessage() bool`

HasErrorMessage returns a boolean if a field has been set.


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

Expand Down

0 comments on commit 9d08d3b

Please sign in to comment.