Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor and rename persistence #23

Merged
merged 6 commits into from
Dec 11, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
108 changes: 37 additions & 71 deletions iwf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,14 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
/api/v1/workflow/cancel:
/api/v1/workflow/stop:
post:
summary: "cancel a workflow"
summary: "stop a workflow"
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/WorkflowCancelRequest'
$ref: '#/components/schemas/WorkflowStopRequest'
responses:
'200':
description: successful operation
Expand All @@ -68,21 +68,21 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
/api/v1/workflow/queryattributes/get:
/api/v1/workflow/dataobjects/get:
post:
summary: "get workflow query attributes"
summary: "get workflow data objects"
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/WorkflowGetQueryAttributesRequest'
$ref: '#/components/schemas/WorkflowGetDataObjectsRequest'
responses:
'200':
description: successful operation
content:
application/json:
schema:
$ref: '#/components/schemas/WorkflowGetQueryAttributesResponse'
$ref: '#/components/schemas/WorkflowGetDataObjectsResponse'
'400':
description: Invalid input
content:
Expand Down Expand Up @@ -300,9 +300,9 @@ components:
type: object
properties:
searchAttributesLoadingPolicy:
$ref: '#/components/schemas/AttributesLoadingPolicy'
queryAttributesLoadingPolicy:
$ref: '#/components/schemas/AttributesLoadingPolicy'
$ref: '#/components/schemas/PersistenceLoadingPolicy'
dataObjectsLoadingPolicy:
$ref: '#/components/schemas/PersistenceLoadingPolicy'
commandCarryOverPolicy:
$ref: '#/components/schemas/CommandCarryOverPolicy'
startApiRetryPolicy:
Expand All @@ -323,17 +323,17 @@ components:
type: string
retryPolicy:
$ref: '#/components/schemas/RetryPolicy'
AttributesLoadingPolicy:
PersistenceLoadingPolicy:
type: object
properties:
attributeLoadingType:
persistenceLoadingType:
type: string
enum:
- LOAD_ALL_WITHOUT_LOCKING
# - LOAD_ALL_WITH_EXCLUSIVE_LOCK
# - LOAD_PARTIAL_WITHOUT_LOCKING
# - LOAD_PARTIAL_WITH_EXCLUSIVE_LOCK
attributeKeys:
partialLoadingKeys:
type: array
items:
type: string
Expand Down Expand Up @@ -396,7 +396,7 @@ components:
type: string
signalValue:
$ref: '#/components/schemas/EncodedObject'
WorkflowCancelRequest:
WorkflowStopRequest:
type: object
required:
- workflowId
Expand All @@ -407,7 +407,13 @@ components:
type: string
reason:
type: string
WorkflowGetQueryAttributesRequest:
stopType:
type: string
enum:
- CANCEL # default behavior
- TERMINATE # this will hard terminate the workflow
- FAIL
WorkflowGetDataObjectsRequest:
type: object
required:
- workflowId
Expand All @@ -416,14 +422,14 @@ components:
type: string
workflowRunId:
type: string
attributeKeys: # return all attributes if this is empty
keys: # return all objects if this is empty
type: array
items:
type: string
WorkflowGetQueryAttributesResponse:
WorkflowGetDataObjectsResponse:
type: object
properties:
queryAttributes:
keys:
type: array
items:
$ref: '#/components/schemas/KeyValue'
Expand All @@ -436,7 +442,7 @@ components:
type: string
workflowRunId:
type: string
attributeKeys: # return all attributes if this is empty
keys: # return all search attributes if this is empty
type: array
items:
$ref: '#/components/schemas/SearchAttributeKeyAndType'
Expand Down Expand Up @@ -535,24 +541,15 @@ components:
type: string
enum:
- HISTORY_EVENT_ID
- FIRST_DECISION_COMPLETED
- LAST_DECISION_COMPLETED
- LAST_CONTINUED_AS_NEW
- BAD_BINARY
- DECISION_COMPLETED_TIME
- FIRST_DECISION_SCHEDULED
- LAST_DECISION_SCHEDULED
historyEventId: #The eventID of any event after DecisionTaskStarted you want to reset to (this event is exclusive in a new run. The new run history will fork and continue from the previous eventID of this). It can be DecisionTaskCompleted, DecisionTaskFailed or others
- BEGINNING
- EVENT_TIME
historyEventId: #required for resetType of HISTORY_EVENT_ID. The eventID of any event after DecisionTaskStarted you want to reset to (this event is exclusive in a new run. The new run history will fork and continue from the previous eventID of this). It can be DecisionTaskCompleted, DecisionTaskFailed or others
type: integer
reason: #reason to do the reset for tracking purpose
type: string
decision_offset: #based on the reset point calculated by resetType, this offset will move/offset the point by decision. Currently only negative number is supported, and only works with LastDecisionCompleted
type: integer
reset_bad_binary_checksum: #Binary checksum for resetType of BadBinary
type: string
earliest_time: #EarliestTime of decision start time, required for resetType of DecisionCompletedTime.Supported formats are '2006-01-02T15:04:05+07:00', raw UnixNano and time range (N<duration>), where 0 < N < 1000000 and duration (full-notation/short-notation) can be second/s, minute/m, hour/h, day/d, week/w, month/M or year/y. For example, '15minute' or '15m' implies last 15 minutes, meaning that workflow will be reset to the first decision that completed in last 15 minutes
eventTime: #Earliest time of event time, required for resetType of EVENT_TIME.Supported formats are '2006-01-02T15:04:05+07:00', raw UnixNano and time range (N<duration>), where 0 < N < 1000000 and duration (full-notation/short-notation) can be second/s, minute/m, hour/h, day/d, week/w, month/M or year/y. For example, '15minute' or '15m' implies last 15 minutes, meaning that workflow will be reset to the first decision that completed in last 15 minutes
type: string
skip_signal_reapply: #whether or not skipping signals reapply after the reset point
skipSignalReapply: # whether skipping signals reapply after the reset point
type: boolean
WorkflowResetResponse:
type: object
Expand Down Expand Up @@ -580,7 +577,7 @@ components:
type: array
items:
$ref: '#/components/schemas/SearchAttribute'
queryAttributes:
dataObjects:
type: array
items:
$ref: '#/components/schemas/KeyValue'
Expand All @@ -591,13 +588,13 @@ components:
type: array
items:
$ref: '#/components/schemas/SearchAttribute'
upsertQueryAttributes:
upsertDataObjects:
type: array
items:
$ref: '#/components/schemas/KeyValue'
commandRequest:
$ref: '#/components/schemas/CommandRequest'
upsertStateLocalAttributes:
upsertStateLocals:
type: array
items:
$ref: '#/components/schemas/KeyValue'
Expand Down Expand Up @@ -628,11 +625,11 @@ components:
type: array
items:
$ref: '#/components/schemas/SearchAttribute'
queryAttributes:
DataObjects:
type: array
items:
$ref: '#/components/schemas/KeyValue'
stateLocalAttributes:
stateLocals :
type: array
items:
$ref: '#/components/schemas/KeyValue'
Expand All @@ -647,15 +644,15 @@ components:
type: array
items:
$ref: '#/components/schemas/SearchAttribute'
upsertQueryAttributes:
upsertDataObjects:
type: array
items:
$ref: '#/components/schemas/KeyValue'
recordEvents:
type: array
items:
$ref: '#/components/schemas/KeyValue'
upsertStateLocalAttributes: # this is probably no much value but we keep it to make the APIs more consistent
upsertStateLocals: # this is probably no much value but we keep it to make the APIs more consistent
type: array
items:
$ref: '#/components/schemas/KeyValue'
Expand Down Expand Up @@ -710,10 +707,6 @@ components:
type: array
items:
$ref: '#/components/schemas/InterStateChannelCommand'
# waitForQueryAttributeChangeCommands:
# type: array
# items:
# $ref: '#/components/schemas/WaitForQueryAttributeChangeCommand'
CommandResults:
type: object
properties:
Expand All @@ -733,10 +726,6 @@ components:
type: array
items:
$ref: '#/components/schemas/TimerResult'
# waitForQueryAttributeChangeResults:
# type: array
# items:
# $ref: '#/components/schemas/WaitForQueryAttributeChangeResult'
# ActivityCommand:
# required:
# - commandId
Expand Down Expand Up @@ -782,16 +771,6 @@ components:
type: string
channelName:
type: string
# WaitForQueryAttributeChangeCommand:
# type: object
# required:
# - commandId
# - attributeKey
# properties:
# commandId:
# type: string
# attributeKey:
# type: string
# ActivityOptions:
# type: object
# properties:
Expand Down Expand Up @@ -837,19 +816,6 @@ components:
enum:
- SCHEDULED
- FIRED
# WaitForQueryAttributeChangeResult:
# type: object
# required:
# - commandId
# - status
# properties:
# commandId:
# type: string
# status:
# type: string
# enum:
# - WAITING
# - COMPLETED
SignalResult:
type: object
required:
Expand Down