|
| 1 | +// Copyright 2022 The Serverless Workflow Specification Authors |
| 2 | +// |
| 3 | +// Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +// you may not use this file except in compliance with the License. |
| 5 | +// You may obtain a copy of the License at |
| 6 | +// |
| 7 | +// http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +// |
| 9 | +// Unless required by applicable law or agreed to in writing, software |
| 10 | +// distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +// See the License for the specific language governing permissions and |
| 13 | +// limitations under the License. |
| 14 | + |
| 15 | +package model |
| 16 | + |
| 17 | +// CallbackState executes a function and waits for callback event that indicates |
| 18 | +// completion of the task. |
| 19 | +type CallbackState struct { |
| 20 | + BaseState |
| 21 | + // Defines the action to be executed |
| 22 | + Action Action `json:"action" validate:"required"` |
| 23 | + // References a unique callback event name in the defined workflow events |
| 24 | + EventRef string `json:"eventRef" validate:"required"` |
| 25 | + // Time period to wait for incoming events (ISO 8601 format) |
| 26 | + Timeouts *CallbackStateTimeout `json:"timeouts" validate:"omitempty"` |
| 27 | + // Event data filter |
| 28 | + EventDataFilter EventDataFilter `json:"eventDataFilter,omitempty"` |
| 29 | +} |
| 30 | + |
| 31 | +// CallbackStateTimeout defines timeout settings for callback state |
| 32 | +type CallbackStateTimeout struct { |
| 33 | + StateExecTimeout *StateExecTimeout `json:"stateExecTimeout,omitempty"` |
| 34 | + ActionExecTimeout string `json:"actionExecTimeout,omitempty" validate:"omitempty,iso8601duration"` |
| 35 | + EventTimeout string `json:"eventTimeout,omitempty" validate:"omitempty,iso8601duration"` |
| 36 | +} |
0 commit comments