Skip to content

Commit

Permalink
Add commandId back as required field in commandResults for SDK backwa…
Browse files Browse the repository at this point in the history
…rd compatibility (#422)
  • Loading branch information
longquanzheng authored Sep 18, 2024
1 parent 3ca6451 commit 470b862
Show file tree
Hide file tree
Showing 9 changed files with 52 additions and 92 deletions.
3 changes: 3 additions & 0 deletions gen/iwfidl/api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2708,6 +2708,7 @@ components:
timerStatus:
$ref: '#/components/schemas/TimerStatus'
required:
- commandId
- timerStatus
type: object
TimerStatus:
Expand All @@ -2733,6 +2734,7 @@ components:
signalValue:
$ref: '#/components/schemas/EncodedObject'
required:
- commandId
- signalChannelName
- signalRequestStatus
type: object
Expand All @@ -2755,6 +2757,7 @@ components:
$ref: '#/components/schemas/EncodedObject'
required:
- channelName
- commandId
- requestStatus
type: object
ChannelRequestStatus:
Expand Down
9 changes: 2 additions & 7 deletions gen/iwfidl/docs/InterStateChannelResult.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**CommandId** | Pointer to **string** | | [optional]
**CommandId** | **string** | |
**RequestStatus** | [**ChannelRequestStatus**](ChannelRequestStatus.md) | |
**ChannelName** | **string** | |
**Value** | Pointer to [**EncodedObject**](EncodedObject.md) | | [optional]
Expand All @@ -13,7 +13,7 @@ Name | Type | Description | Notes

### NewInterStateChannelResult

`func NewInterStateChannelResult(requestStatus ChannelRequestStatus, channelName string, ) *InterStateChannelResult`
`func NewInterStateChannelResult(commandId string, requestStatus ChannelRequestStatus, channelName string, ) *InterStateChannelResult`

NewInterStateChannelResult instantiates a new InterStateChannelResult object
This constructor will assign default values to properties that have it defined,
Expand Down Expand Up @@ -47,11 +47,6 @@ and a boolean to check if the value has been set.

SetCommandId sets CommandId field to given value.

### HasCommandId

`func (o *InterStateChannelResult) HasCommandId() bool`

HasCommandId returns a boolean if a field has been set.

### GetRequestStatus

Expand Down
9 changes: 2 additions & 7 deletions gen/iwfidl/docs/SignalResult.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**CommandId** | Pointer to **string** | | [optional]
**CommandId** | **string** | |
**SignalRequestStatus** | [**ChannelRequestStatus**](ChannelRequestStatus.md) | |
**SignalChannelName** | **string** | |
**SignalValue** | Pointer to [**EncodedObject**](EncodedObject.md) | | [optional]
Expand All @@ -13,7 +13,7 @@ Name | Type | Description | Notes

### NewSignalResult

`func NewSignalResult(signalRequestStatus ChannelRequestStatus, signalChannelName string, ) *SignalResult`
`func NewSignalResult(commandId string, signalRequestStatus ChannelRequestStatus, signalChannelName string, ) *SignalResult`

NewSignalResult instantiates a new SignalResult object
This constructor will assign default values to properties that have it defined,
Expand Down Expand Up @@ -47,11 +47,6 @@ and a boolean to check if the value has been set.

SetCommandId sets CommandId field to given value.

### HasCommandId

`func (o *SignalResult) HasCommandId() bool`

HasCommandId returns a boolean if a field has been set.

### GetSignalRequestStatus

Expand Down
9 changes: 2 additions & 7 deletions gen/iwfidl/docs/TimerResult.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**CommandId** | Pointer to **string** | | [optional]
**CommandId** | **string** | |
**TimerStatus** | [**TimerStatus**](TimerStatus.md) | |

## Methods

### NewTimerResult

`func NewTimerResult(timerStatus TimerStatus, ) *TimerResult`
`func NewTimerResult(commandId string, timerStatus TimerStatus, ) *TimerResult`

NewTimerResult instantiates a new TimerResult object
This constructor will assign default values to properties that have it defined,
Expand Down Expand Up @@ -45,11 +45,6 @@ and a boolean to check if the value has been set.

SetCommandId sets CommandId field to given value.

### HasCommandId

`func (o *TimerResult) HasCommandId() bool`

HasCommandId returns a boolean if a field has been set.

### GetTimerStatus

Expand Down
35 changes: 13 additions & 22 deletions gen/iwfidl/model_inter_state_channel_result.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

35 changes: 13 additions & 22 deletions gen/iwfidl/model_signal_result.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

35 changes: 13 additions & 22 deletions gen/iwfidl/model_timer_result.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion iwf-idl
Submodule iwf-idl updated 2 files
+3 −0 iwf-sdk.yaml
+3 −0 iwf.yaml
7 changes: 3 additions & 4 deletions service/interpreter/workflowImpl.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"context"
"fmt"
uclient "github.com/indeedeng/iwf/service/client"
"github.com/indeedeng/iwf/service/common/ptr"
"github.com/indeedeng/iwf/service/interpreter/env"
"time"

Expand Down Expand Up @@ -656,7 +655,7 @@ func executeState(
status = iwfidl.FIRED
}
timerResults = append(timerResults, iwfidl.TimerResult{
CommandId: ptr.Any(cmd.GetCommandId()),
CommandId: cmd.GetCommandId(),
TimerStatus: status,
})
}
Expand All @@ -673,7 +672,7 @@ func executeState(
}

signalResults = append(signalResults, iwfidl.SignalResult{
CommandId: ptr.Any(cmd.GetCommandId()),
CommandId: cmd.GetCommandId(),
SignalChannelName: cmd.GetSignalChannelName(),
SignalValue: result,
SignalRequestStatus: status,
Expand All @@ -692,7 +691,7 @@ func executeState(
}

interStateChannelResults = append(interStateChannelResults, iwfidl.InterStateChannelResult{
CommandId: cmd.CommandId,
CommandId: cmd.GetCommandId(),
ChannelName: cmd.ChannelName,
RequestStatus: status,
Value: result,
Expand Down

0 comments on commit 470b862

Please sign in to comment.