From 701f062ef65466f05a5df685f2a31a7d85fd8286 Mon Sep 17 00:00:00 2001 From: Quanzheng Long Date: Sat, 10 Dec 2022 20:42:54 -0800 Subject: [PATCH 1/6] persistence loading type --- iwf.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iwf.yaml b/iwf.yaml index 342d4d0..5a47b52 100644 --- a/iwf.yaml +++ b/iwf.yaml @@ -323,10 +323,10 @@ components: type: string retryPolicy: $ref: '#/components/schemas/RetryPolicy' - AttributesLoadingPolicy: + PersistenceLoadingPolicy: type: object properties: - attributeLoadingType: + persistenceLoadingType: type: string enum: - LOAD_ALL_WITHOUT_LOCKING From 0d8d27024b17b1db7317e0220604487174ea3db2 Mon Sep 17 00:00:00 2001 From: Quanzheng Long Date: Sat, 10 Dec 2022 20:43:36 -0800 Subject: [PATCH 2/6] partial --- iwf.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iwf.yaml b/iwf.yaml index 5a47b52..2f58442 100644 --- a/iwf.yaml +++ b/iwf.yaml @@ -333,7 +333,7 @@ components: # - LOAD_ALL_WITH_EXCLUSIVE_LOCK # - LOAD_PARTIAL_WITHOUT_LOCKING # - LOAD_PARTIAL_WITH_EXCLUSIVE_LOCK - attributeKeys: + partialLoadingKeys: type: array items: type: string From b29b087abc5abc38c498b929ee860b23fcd8911d Mon Sep 17 00:00:00 2001 From: Quanzheng Long Date: Sat, 10 Dec 2022 20:58:59 -0800 Subject: [PATCH 3/6] query attribute -> data object --- iwf.yaml | 69 ++++++++++++++++---------------------------------------- 1 file changed, 19 insertions(+), 50 deletions(-) diff --git a/iwf.yaml b/iwf.yaml index 2f58442..b6c77a6 100644 --- a/iwf.yaml +++ b/iwf.yaml @@ -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: @@ -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: @@ -407,7 +407,7 @@ components: type: string reason: type: string - WorkflowGetQueryAttributesRequest: + WorkflowGetDataObjectsRequest: type: object required: - workflowId @@ -416,14 +416,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' @@ -436,7 +436,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' @@ -580,7 +580,7 @@ components: type: array items: $ref: '#/components/schemas/SearchAttribute' - queryAttributes: + dataObjects: type: array items: $ref: '#/components/schemas/KeyValue' @@ -591,13 +591,13 @@ components: type: array items: $ref: '#/components/schemas/SearchAttribute' - upsertQueryAttributes: + upsertDataObjects: type: array items: $ref: '#/components/schemas/KeyValue' commandRequest: $ref: '#/components/schemas/CommandRequest' - upsertStateLocalAttributes: + upsertStateLocalObjects: type: array items: $ref: '#/components/schemas/KeyValue' @@ -628,11 +628,11 @@ components: type: array items: $ref: '#/components/schemas/SearchAttribute' - queryAttributes: + DataObjects: type: array items: $ref: '#/components/schemas/KeyValue' - stateLocalAttributes: + stateLocalObjects: type: array items: $ref: '#/components/schemas/KeyValue' @@ -647,7 +647,7 @@ components: type: array items: $ref: '#/components/schemas/SearchAttribute' - upsertQueryAttributes: + upsertDataObjects: type: array items: $ref: '#/components/schemas/KeyValue' @@ -655,7 +655,7 @@ components: type: array items: $ref: '#/components/schemas/KeyValue' - upsertStateLocalAttributes: # this is probably no much value but we keep it to make the APIs more consistent + upsertStateLocalObjects: # this is probably no much value but we keep it to make the APIs more consistent type: array items: $ref: '#/components/schemas/KeyValue' @@ -710,10 +710,6 @@ components: type: array items: $ref: '#/components/schemas/InterStateChannelCommand' -# waitForQueryAttributeChangeCommands: -# type: array -# items: -# $ref: '#/components/schemas/WaitForQueryAttributeChangeCommand' CommandResults: type: object properties: @@ -733,10 +729,6 @@ components: type: array items: $ref: '#/components/schemas/TimerResult' -# waitForQueryAttributeChangeResults: -# type: array -# items: -# $ref: '#/components/schemas/WaitForQueryAttributeChangeResult' # ActivityCommand: # required: # - commandId @@ -782,16 +774,6 @@ components: type: string channelName: type: string -# WaitForQueryAttributeChangeCommand: -# type: object -# required: -# - commandId -# - attributeKey -# properties: -# commandId: -# type: string -# attributeKey: -# type: string # ActivityOptions: # type: object # properties: @@ -837,19 +819,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: From 89d818116631c1a151ac07feac1f114159df6979 Mon Sep 17 00:00:00 2001 From: Quanzheng Long Date: Sat, 10 Dec 2022 21:15:04 -0800 Subject: [PATCH 4/6] reset --- iwf.yaml | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/iwf.yaml b/iwf.yaml index b6c77a6..aadf649 100644 --- a/iwf.yaml +++ b/iwf.yaml @@ -535,24 +535,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), 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), 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 From 61ef6826960a7abdb5790cd72c2f3930e1e2f6ca Mon Sep 17 00:00:00 2001 From: Quanzheng Long Date: Sat, 10 Dec 2022 21:17:36 -0800 Subject: [PATCH 5/6] stop --- iwf.yaml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/iwf.yaml b/iwf.yaml index aadf649..a91e03b 100644 --- a/iwf.yaml +++ b/iwf.yaml @@ -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 @@ -396,7 +396,7 @@ components: type: string signalValue: $ref: '#/components/schemas/EncodedObject' - WorkflowCancelRequest: + WorkflowStopRequest: type: object required: - workflowId @@ -407,6 +407,12 @@ components: type: string reason: type: string + stopType: + type: string + enum: + - CANCEL # default behavior + - TERMINATE # this will hard terminate the workflow + - FAIL WorkflowGetDataObjectsRequest: type: object required: From 8e9d5a3f2697a5be39fd51f0230095c930f21e0a Mon Sep 17 00:00:00 2001 From: Quanzheng Long Date: Sat, 10 Dec 2022 21:21:05 -0800 Subject: [PATCH 6/6] state locals --- iwf.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/iwf.yaml b/iwf.yaml index a91e03b..7849e60 100644 --- a/iwf.yaml +++ b/iwf.yaml @@ -594,7 +594,7 @@ components: $ref: '#/components/schemas/KeyValue' commandRequest: $ref: '#/components/schemas/CommandRequest' - upsertStateLocalObjects: + upsertStateLocals: type: array items: $ref: '#/components/schemas/KeyValue' @@ -629,7 +629,7 @@ components: type: array items: $ref: '#/components/schemas/KeyValue' - stateLocalObjects: + stateLocals : type: array items: $ref: '#/components/schemas/KeyValue' @@ -652,7 +652,7 @@ components: type: array items: $ref: '#/components/schemas/KeyValue' - upsertStateLocalObjects: # 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'