Skip to content

Commit

Permalink
Add describe execution API (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
longquanzheng authored Sep 27, 2023
1 parent 5041a53 commit f01d0cd
Show file tree
Hide file tree
Showing 12 changed files with 1,039 additions and 37 deletions.
52 changes: 51 additions & 1 deletion api-schema/xdb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,34 @@ paths:
content:
application/json:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
$ref: '#/components/schemas/ApiErrorResponse'
/api/v1/xdb/service/process-execution/desribe:
post:
summary: describe a process execution
requestBody:
content:
'application/json':
schema:
$ref: '#/components/schemas/ProcessExecutionDescribeRequest'
responses:
'200':
description: successful operation
content:
application/json:
schema:
$ref: '#/components/schemas/ProcessExecutionDescribeResponse'
'400':
description: Invalid request
content:
application/json:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
'404':
description: Process execution not exists
content:
application/json:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
# xdb workers APIs are hosted by iWF applications via SDKs, for iWF server to call back
/api/v1/xdb/worker/async-state/wait-until:
post:
Expand Down Expand Up @@ -79,6 +106,29 @@ paths:

components:
schemas:
ProcessExecutionDescribeRequest:
type: object
properties:
processId:
type: string
ProcessExecutionDescribeResponse:
type: object
properties:
processExecutionId:
type: string
processType:
type: string
description: the process type for SDK to lookup the process definition class
workerUrl:
type: string
description: the URL for XDB async service to make callback to worker
startStateId:
type: string
description: StateId of the first AsyncState to start
startStateConfig: # config for the startState
$ref: '#/components/schemas/AsyncStateConfig'
processStartConfig: # more configs for the process execution
$ref: '#/components/schemas/ProcessStartConfig'
AsyncStateWaitUntilRequest:
type: object
description: the input of the waitUntil API
Expand Down
6 changes: 5 additions & 1 deletion goapi/xdbapi/.openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ docs/AsyncStateWaitUntilResponse.md
docs/CommandRequest.md
docs/CommandWaitingType.md
docs/Context.md
docs/DefaultApi.md
docs/DefaultAPI.md
docs/EncodedObject.md
docs/ProcessExecutionDescribeRequest.md
docs/ProcessExecutionDescribeResponse.md
docs/ProcessExecutionStartRequest.md
docs/ProcessExecutionStartResponse.md
docs/ProcessIdReusePolicy.md
Expand All @@ -39,6 +41,8 @@ model_command_request.go
model_command_waiting_type.go
model_context.go
model_encoded_object.go
model_process_execution_describe_request.go
model_process_execution_describe_response.go
model_process_execution_start_request.go
model_process_execution_start_response.go
model_process_id_reuse_policy.go
Expand Down
2 changes: 1 addition & 1 deletion goapi/xdbapi/.openapi-generator/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.6.0
7.0.1
9 changes: 6 additions & 3 deletions goapi/xdbapi/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,10 @@ All URIs are relative to *http://localhost*

Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*DefaultApi* | [**ApiV1XdbServiceProcessExecutionStartPost**](docs/DefaultApi.md#apiv1xdbserviceprocessexecutionstartpost) | **Post** /api/v1/xdb/service/process-execution/start | start a process execution
*DefaultApi* | [**ApiV1XdbWorkerAsyncStateExecutePost**](docs/DefaultApi.md#apiv1xdbworkerasyncstateexecutepost) | **Post** /api/v1/xdb/worker/async-state/execute | invoking AsyncState.execute API
*DefaultApi* | [**ApiV1XdbWorkerAsyncStateWaitUntilPost**](docs/DefaultApi.md#apiv1xdbworkerasyncstatewaituntilpost) | **Post** /api/v1/xdb/worker/async-state/wait-until | invoking AsyncState.waitUntil API
*DefaultAPI* | [**ApiV1XdbServiceProcessExecutionDesribePost**](docs/DefaultAPI.md#apiv1xdbserviceprocessexecutiondesribepost) | **Post** /api/v1/xdb/service/process-execution/desribe | describe a process execution
*DefaultAPI* | [**ApiV1XdbServiceProcessExecutionStartPost**](docs/DefaultAPI.md#apiv1xdbserviceprocessexecutionstartpost) | **Post** /api/v1/xdb/service/process-execution/start | start a process execution
*DefaultAPI* | [**ApiV1XdbWorkerAsyncStateExecutePost**](docs/DefaultAPI.md#apiv1xdbworkerasyncstateexecutepost) | **Post** /api/v1/xdb/worker/async-state/execute | invoking AsyncState.execute API
*DefaultAPI* | [**ApiV1XdbWorkerAsyncStateWaitUntilPost**](docs/DefaultAPI.md#apiv1xdbworkerasyncstatewaituntilpost) | **Post** /api/v1/xdb/worker/async-state/wait-until | invoking AsyncState.waitUntil API


## Documentation For Models
Expand All @@ -94,6 +95,8 @@ Class | Method | HTTP request | Description
- [CommandWaitingType](docs/CommandWaitingType.md)
- [Context](docs/Context.md)
- [EncodedObject](docs/EncodedObject.md)
- [ProcessExecutionDescribeRequest](docs/ProcessExecutionDescribeRequest.md)
- [ProcessExecutionDescribeResponse](docs/ProcessExecutionDescribeResponse.md)
- [ProcessExecutionStartRequest](docs/ProcessExecutionStartRequest.md)
- [ProcessExecutionStartResponse](docs/ProcessExecutionStartResponse.md)
- [ProcessIdReusePolicy](docs/ProcessIdReusePolicy.md)
Expand Down
62 changes: 62 additions & 0 deletions goapi/xdbapi/api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,33 @@ paths:
$ref: '#/components/schemas/ApiErrorResponse'
description: Process already started
summary: start a process execution
/api/v1/xdb/service/process-execution/desribe:
post:
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/ProcessExecutionDescribeRequest'
responses:
"200":
content:
application/json:
schema:
$ref: '#/components/schemas/ProcessExecutionDescribeResponse'
description: successful operation
"400":
content:
application/json:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
description: Invalid request
"404":
content:
application/json:
schema:
$ref: '#/components/schemas/ApiErrorResponse'
description: Process execution not exists
summary: describe a process execution
/api/v1/xdb/worker/async-state/wait-until:
post:
requestBody:
Expand Down Expand Up @@ -77,6 +104,41 @@ paths:
summary: invoking AsyncState.execute API
components:
schemas:
ProcessExecutionDescribeRequest:
example:
processId: processId
properties:
processId:
type: string
type: object
ProcessExecutionDescribeResponse:
example:
startStateConfig:
skipWaitUntil: true
workerUrl: workerUrl
startStateId: startStateId
processExecutionId: processExecutionId
processStartConfig:
timeoutSeconds: 0
idReusePolicy: null
processType: processType
properties:
processExecutionId:
type: string
processType:
description: the process type for SDK to lookup the process definition class
type: string
workerUrl:
description: the URL for XDB async service to make callback to worker
type: string
startStateId:
description: StateId of the first AsyncState to start
type: string
startStateConfig:
$ref: '#/components/schemas/AsyncStateConfig'
processStartConfig:
$ref: '#/components/schemas/ProcessStartConfig'
type: object
AsyncStateWaitUntilRequest:
description: the input of the waitUntil API
example:
Expand Down
Loading

0 comments on commit f01d0cd

Please sign in to comment.