feat: add optional Spring REST adapter and catalog SPI
Expose OrdoEngine over conditionally registered HTTP endpoints in autoconfigure, keep JDBC wiring in spring.jdbc, and share definition JSON via ProcessDefinitionParser.toJson. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,490 @@
|
||||
openapi: 3.0.3
|
||||
info:
|
||||
title: Ordo REST
|
||||
version: 0.0.1-SNAPSHOT
|
||||
description: Optional Spring adapter over OrdoEngine. No authentication. Default base path `/ordo`.
|
||||
servers:
|
||||
- url: /ordo
|
||||
paths:
|
||||
/definitions/parse:
|
||||
post:
|
||||
summary: Parse definition JSON without publishing
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ProcessDefinitionDocument'
|
||||
responses:
|
||||
'200':
|
||||
description: Parsed graph (version 0)
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ProcessDefinitionDocument'
|
||||
'400':
|
||||
$ref: '#/components/responses/Error'
|
||||
/definitions:
|
||||
post:
|
||||
summary: Parse and publish
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ProcessDefinitionDocument'
|
||||
responses:
|
||||
'201':
|
||||
description: Published definition
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ProcessDefinitionDocument'
|
||||
'400':
|
||||
$ref: '#/components/responses/Error'
|
||||
get:
|
||||
summary: Latest version of each definition
|
||||
parameters:
|
||||
- $ref: '#/components/parameters/page'
|
||||
- $ref: '#/components/parameters/size'
|
||||
responses:
|
||||
'200':
|
||||
description: Page of definitions
|
||||
/definitions/{definitionId}:
|
||||
get:
|
||||
parameters:
|
||||
- $ref: '#/components/parameters/definitionId'
|
||||
responses:
|
||||
'200':
|
||||
description: Latest definition
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ProcessDefinitionDocument'
|
||||
'404':
|
||||
description: Not found
|
||||
/definitions/{definitionId}/versions:
|
||||
get:
|
||||
parameters:
|
||||
- $ref: '#/components/parameters/definitionId'
|
||||
- $ref: '#/components/parameters/page'
|
||||
- $ref: '#/components/parameters/size'
|
||||
responses:
|
||||
'200':
|
||||
description: Versions newest first
|
||||
/definitions/{definitionId}/versions/{version}:
|
||||
get:
|
||||
parameters:
|
||||
- $ref: '#/components/parameters/definitionId'
|
||||
- name: version
|
||||
in: path
|
||||
required: true
|
||||
schema:
|
||||
type: integer
|
||||
minimum: 1
|
||||
responses:
|
||||
'200':
|
||||
description: Specific version
|
||||
'404':
|
||||
description: Not found
|
||||
/instances:
|
||||
post:
|
||||
summary: Start an instance
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
required: [definitionId, initiator]
|
||||
properties:
|
||||
definitionId:
|
||||
type: string
|
||||
initiator:
|
||||
type: string
|
||||
context:
|
||||
type: object
|
||||
properties:
|
||||
variables:
|
||||
type: object
|
||||
additionalProperties: true
|
||||
responses:
|
||||
'200':
|
||||
description: Started instance
|
||||
'404':
|
||||
$ref: '#/components/responses/Error'
|
||||
get:
|
||||
parameters:
|
||||
- name: definitionId
|
||||
in: query
|
||||
schema:
|
||||
type: string
|
||||
- name: status
|
||||
in: query
|
||||
schema:
|
||||
type: string
|
||||
- name: initiator
|
||||
in: query
|
||||
schema:
|
||||
type: string
|
||||
- name: startedFrom
|
||||
in: query
|
||||
schema:
|
||||
type: string
|
||||
format: date-time
|
||||
- name: startedTo
|
||||
in: query
|
||||
schema:
|
||||
type: string
|
||||
format: date-time
|
||||
- $ref: '#/components/parameters/page'
|
||||
- $ref: '#/components/parameters/size'
|
||||
responses:
|
||||
'200':
|
||||
description: Page of instances
|
||||
/instances/{instanceId}:
|
||||
get:
|
||||
parameters:
|
||||
- $ref: '#/components/parameters/instanceId'
|
||||
responses:
|
||||
'200':
|
||||
description: Instance
|
||||
'404':
|
||||
description: Not found
|
||||
/instances/{instanceId}/withdraw:
|
||||
post:
|
||||
parameters:
|
||||
- $ref: '#/components/parameters/instanceId'
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ActorComment'
|
||||
responses:
|
||||
'200':
|
||||
description: Withdrawn
|
||||
'403':
|
||||
$ref: '#/components/responses/Error'
|
||||
'404':
|
||||
$ref: '#/components/responses/Error'
|
||||
'409':
|
||||
$ref: '#/components/responses/Error'
|
||||
/instances/{instanceId}/cancel:
|
||||
post:
|
||||
parameters:
|
||||
- $ref: '#/components/parameters/instanceId'
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ActorComment'
|
||||
responses:
|
||||
'200':
|
||||
description: Cancelled
|
||||
'404':
|
||||
$ref: '#/components/responses/Error'
|
||||
'409':
|
||||
$ref: '#/components/responses/Error'
|
||||
/instances/{instanceId}/tasks:
|
||||
get:
|
||||
parameters:
|
||||
- $ref: '#/components/parameters/instanceId'
|
||||
responses:
|
||||
'200':
|
||||
description: All tasks
|
||||
/instances/{instanceId}/tasks/pending:
|
||||
get:
|
||||
parameters:
|
||||
- $ref: '#/components/parameters/instanceId'
|
||||
responses:
|
||||
'200':
|
||||
description: Pending tasks
|
||||
/instances/{instanceId}/history:
|
||||
get:
|
||||
parameters:
|
||||
- $ref: '#/components/parameters/instanceId'
|
||||
- $ref: '#/components/parameters/page'
|
||||
- $ref: '#/components/parameters/size'
|
||||
responses:
|
||||
'200':
|
||||
description: Timeline
|
||||
/instances/{instanceId}/action-executions:
|
||||
get:
|
||||
parameters:
|
||||
- $ref: '#/components/parameters/instanceId'
|
||||
- $ref: '#/components/parameters/page'
|
||||
- $ref: '#/components/parameters/size'
|
||||
responses:
|
||||
'200':
|
||||
description: ACTION executions
|
||||
/tasks:
|
||||
get:
|
||||
parameters:
|
||||
- name: assignee
|
||||
in: query
|
||||
schema:
|
||||
type: string
|
||||
- name: instanceId
|
||||
in: query
|
||||
schema:
|
||||
type: string
|
||||
- name: definitionId
|
||||
in: query
|
||||
schema:
|
||||
type: string
|
||||
- name: status
|
||||
in: query
|
||||
schema:
|
||||
type: string
|
||||
- name: createdFrom
|
||||
in: query
|
||||
schema:
|
||||
type: string
|
||||
format: date-time
|
||||
- name: createdTo
|
||||
in: query
|
||||
schema:
|
||||
type: string
|
||||
format: date-time
|
||||
- $ref: '#/components/parameters/page'
|
||||
- $ref: '#/components/parameters/size'
|
||||
responses:
|
||||
'200':
|
||||
description: Page of tasks
|
||||
/tasks/pending:
|
||||
get:
|
||||
parameters:
|
||||
- name: assignee
|
||||
in: query
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
responses:
|
||||
'200':
|
||||
description: Pending tasks for assignee
|
||||
/tasks/{taskId}:
|
||||
get:
|
||||
parameters:
|
||||
- $ref: '#/components/parameters/taskId'
|
||||
responses:
|
||||
'200':
|
||||
description: Task
|
||||
'404':
|
||||
description: Not found
|
||||
/tasks/{taskId}/approve:
|
||||
post:
|
||||
parameters:
|
||||
- $ref: '#/components/parameters/taskId'
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ActorComment'
|
||||
responses:
|
||||
'200':
|
||||
description: Approved
|
||||
'403':
|
||||
$ref: '#/components/responses/Error'
|
||||
'409':
|
||||
$ref: '#/components/responses/Error'
|
||||
/tasks/{taskId}/reject:
|
||||
post:
|
||||
parameters:
|
||||
- $ref: '#/components/parameters/taskId'
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ActorComment'
|
||||
responses:
|
||||
'200':
|
||||
description: Rejected
|
||||
'403':
|
||||
$ref: '#/components/responses/Error'
|
||||
'409':
|
||||
$ref: '#/components/responses/Error'
|
||||
/tasks/{taskId}/reassign:
|
||||
post:
|
||||
parameters:
|
||||
- $ref: '#/components/parameters/taskId'
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
required: [actor, newAssignee]
|
||||
properties:
|
||||
actor:
|
||||
type: string
|
||||
newAssignee:
|
||||
type: string
|
||||
responses:
|
||||
'200':
|
||||
description: Reassigned
|
||||
'403':
|
||||
$ref: '#/components/responses/Error'
|
||||
'409':
|
||||
$ref: '#/components/responses/Error'
|
||||
/due:
|
||||
post:
|
||||
parameters:
|
||||
- name: limit
|
||||
in: query
|
||||
schema:
|
||||
type: integer
|
||||
minimum: 1
|
||||
default: 100
|
||||
requestBody:
|
||||
required: false
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
limit:
|
||||
type: integer
|
||||
minimum: 1
|
||||
responses:
|
||||
'200':
|
||||
description: Batch result
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
processed:
|
||||
type: integer
|
||||
'400':
|
||||
$ref: '#/components/responses/Error'
|
||||
/catalog/conditions:
|
||||
get:
|
||||
responses:
|
||||
'200':
|
||||
description: conditionKey catalog
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/CatalogItem'
|
||||
/catalog/actions:
|
||||
get:
|
||||
responses:
|
||||
'200':
|
||||
description: actionKey catalog
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/CatalogItem'
|
||||
/catalog/assignees:
|
||||
get:
|
||||
responses:
|
||||
'200':
|
||||
description: Assignee catalog
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/CatalogItem'
|
||||
components:
|
||||
parameters:
|
||||
page:
|
||||
name: page
|
||||
in: query
|
||||
schema:
|
||||
type: integer
|
||||
minimum: 0
|
||||
default: 0
|
||||
size:
|
||||
name: size
|
||||
in: query
|
||||
schema:
|
||||
type: integer
|
||||
minimum: 1
|
||||
default: 20
|
||||
definitionId:
|
||||
name: definitionId
|
||||
in: path
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
instanceId:
|
||||
name: instanceId
|
||||
in: path
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
taskId:
|
||||
name: taskId
|
||||
in: path
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
responses:
|
||||
Error:
|
||||
description: Error body
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/ErrorBody'
|
||||
schemas:
|
||||
ErrorBody:
|
||||
type: object
|
||||
properties:
|
||||
error:
|
||||
type: string
|
||||
message:
|
||||
type: string
|
||||
ActorComment:
|
||||
type: object
|
||||
required: [actor]
|
||||
properties:
|
||||
actor:
|
||||
type: string
|
||||
comment:
|
||||
type: string
|
||||
CatalogItem:
|
||||
type: object
|
||||
properties:
|
||||
key:
|
||||
type: string
|
||||
label:
|
||||
type: string
|
||||
ProcessDefinitionDocument:
|
||||
type: object
|
||||
required: [id, name, steps, transitions]
|
||||
properties:
|
||||
id:
|
||||
type: string
|
||||
name:
|
||||
type: string
|
||||
version:
|
||||
type: integer
|
||||
startStep:
|
||||
type: string
|
||||
steps:
|
||||
type: array
|
||||
items:
|
||||
type: object
|
||||
transitions:
|
||||
type: array
|
||||
items:
|
||||
type: object
|
||||
properties:
|
||||
from:
|
||||
type: string
|
||||
to:
|
||||
type: string
|
||||
nullable: true
|
||||
when:
|
||||
type: string
|
||||
priority:
|
||||
type: integer
|
||||
Reference in New Issue
Block a user