Skip to content

Commit e8ed64b

Browse files
Merge pull request #824 from fjtirado/Fix_#742
[Fix #742] Id, key and name refactor
2 parents 7ae6420 + 877816f commit e8ed64b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+98
-156
lines changed

.ci/validation/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export module SWSchemaValidator {
2525
addFormats(ajv)
2626

2727

28-
const workflowSchemaId = 'https://serverlessworkflow.io/schemas/0.8/workflow.json'
28+
const workflowSchemaId = 'https://serverlessworkflow.io/schemas/0.9/workflow.json'
2929
const schemaPath = '../../../schema'
3030
export const defaultEncoding = 'utf-8'
3131

examples/accumulate-room-readings.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{
2-
"id": "roomreadings",
3-
"name": "roomreadings",
2+
"name": "room-readings",
43
"description": "Room Temp and Humidity Workflow",
54
"version": "1.0.0",
65
"specVersion": "0.8",

examples/applicant-request-decision.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{
2-
"id": "applicantrequest",
32
"version": "1.0.0",
43
"specVersion": "0.8",
54
"name": "applicant-request-decision-workflow",

examples/async-function-invocation.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{
2-
"id": "sendcustomeremail",
32
"version": "1.0.0",
43
"specVersion": "0.8",
54
"name": "send-customer-email-workflow",

examples/async-subflow-invocation.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{
2-
"id": "onboardcustomer",
32
"version": "1.0.0",
43
"specVersion": "0.8",
54
"name": "onboard-customer",

examples/book-lending.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{
2-
"id": "booklending",
3-
"name": "booklending",
2+
"name": "book-lending",
43
"description": "Book Lending Workflow",
54
"version": "1.0.0",
65
"specVersion": "0.8",

examples/car-vitals-checks-subflow.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{
2-
"id": "vitalscheck",
3-
"name": "vitalscheck",
2+
"name": "vitals-check",
43
"description": "Car Vitals Check",
54
"version": "1.0.0",
65
"specVersion": "0.8",

examples/car-vitals-checks.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{
2-
"id": "checkcarvitals",
3-
"name": "checkcarvitals",
2+
"name": "check-car-vitals",
43
"description": "Check Car Vitals Workflow",
54
"version": "1.0.0",
65
"specVersion": "0.8",

examples/check-inbox-periodically.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{
2-
"id": "check-inbox",
32
"name": "check-inbox",
43
"version": "1.0.0",
54
"specVersion": "0.8",

examples/continuing-as-a-new-execution.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{
2-
"id": "notifycustomerworkflow",
3-
"name": "notifycustomerworkflow",
2+
"name": "notify-customer-workflow",
43
"description": "Notify Customer",
54
"version": "1.0.0",
65
"specVersion": "0.8",

examples/event-based-greeting.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
{
2-
"id": "eventbasedgreeting",
32
"version": "1.0.0",
43
"specVersion": "0.8",
5-
"name": "Event Based Greeting Workflow",
4+
"name": "event-based-greeting-workflow",
65
"description": "Event Based Greeting",
76
"start": "greet",
87
"events": [

examples/event-based-service-invocation.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{
2-
"id": "vet-appointment-workflow",
32
"name": "vet-appointment-workflow",
43
"description": "Vet service call via events",
54
"version": "1.0.0",

examples/event-based-transitions.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{
2-
"id": "eventbasedswitchstate",
32
"version": "1.0.0",
43
"specVersion": "0.8",
54
"name": "event-based-switch-transitions",

examples/filling-a-glass-of-water.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{
2-
"id": "fillglassofwater",
3-
"name": "fillglassofwater",
2+
"name": "fill-glass-of-water",
43
"description": "Fill glass of water workflow",
54
"version": "1.0.0",
65
"specVersion": "0.8",

examples/finalize-college-application.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{
2-
"id": "finalize-college-application",
3-
"name": "finalizeCollegeApplication",
2+
"name": "finalize-college-application",
43
"version": "1.0.0",
54
"specVersion": "0.8",
65
"start": "finalize-application",

examples/greeting.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{
2-
"id": "greeting",
32
"version": "1.0.0",
43
"specVersion": "0.8",
54
"name": "greeting-workflow",

examples/handle-car-auction-bids.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{
2-
"id": "handle-car-auction-bid",
32
"version": "1.0.0",
43
"specVersion": "0.8",
54
"name": "handle-car-auction-bid",

examples/hello-world.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
{
2-
"id": "helloworld",
32
"version": "1.0.0",
43
"specVersion": "0.8",
5-
"name": "Hello World Workflow",
4+
"name": "hello-world-workflow",
65
"description": "Inject Hello World",
76
"start": "hello-state",
87
"states": [

examples/monitor-job.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
{
2-
"id": "jobmonitoring",
32
"version": "1.0.0",
43
"specVersion": "0.8",
5-
"name": "jobmonitoring",
4+
"name": "job-monitoring",
65
"description": "Monitor finished execution of a submitted job",
76
"start": "submit-job",
87
"functions": [

examples/monitor-patient-vital-signs.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{
2-
"id": "patientVitalsWorkflow",
3-
"name": "patientVitalsWorkflow",
2+
"name": "patient-vitals-workflow",
43
"version": "1.0.0",
54
"specVersion": "0.8",
65
"start": "monitor-vitals",

examples/new-patient-onboarding.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{
2-
"id": "patientonboarding",
3-
"name": "patientonboarding",
2+
"name": "patient-onboarding",
43
"version": "1.0.0",
54
"specVersion": "0.8",
65
"start": "onboard",

examples/parallel-execution.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{
2-
"id": "parallelexec",
32
"version": "1.0.0",
43
"specVersion": "0.8",
54
"name": "parallel-execution",

examples/perform-customer-credit-check.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
{
2-
"id": "customercreditcheck",
32
"version": "1.0.0",
43
"specVersion": "0.8",
5-
"name": "customercreditcheck",
4+
"name": "customer-credit-check",
65
"description": "Perform Customer Credit Check",
76
"start": "check-credit",
87
"functions": [

examples/process-transactions.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{
2-
"id": "customerbankingtransactions",
3-
"name": "customerbankingtransactions",
2+
"name": "customer-banking-transactions",
43
"description": "Customer Banking Transactions Workflow",
54
"version": "1.0.0",
65
"specVersion": "0.8",

examples/provision-orders.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{
2-
"id": "provisionorders",
32
"version": "1.0.0",
43
"specVersion": "0.8",
54
"name": "provision-orders",

examples/purchase-order-deadline.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{
2-
"id": "order",
32
"name": "order",
43
"description": "Purchase Order Workflow",
54
"version": "1.0.0",

examples/reusing-function-and-event-definitions.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
{
2-
"id": "paymentconfirmation",
32
"version": "1.0.0",
43
"specVersion": "0.8",
5-
"name": "paymentconfirmation",
4+
"name": "payment-confirmation",
65
"description": "Performs Payment Confirmation",
76
"functions": "file://functiondefs.json",
87
"events": "file://eventdefs.yml",

examples/send-cloudevent-on-workflow-completion.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
{
2-
"id": "sendcloudeventonprovision",
32
"version": "1.0.0",
43
"specVersion": "0.8",
5-
"name": "sendcloudeventonprovision",
4+
"name": "send-cloudevent-provision",
65
"start": "provision-orders-state",
76
"events": [
87
{

examples/solving-math-problems.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
{
2-
"id": "solvemathproblems",
32
"version": "1.0.0",
43
"specVersion": "0.8",
5-
"name": "solve-math-problems-workflow",
4+
"name": "solve-math-problems",
65
"description": "Solve math problems",
76
"start": "solve",
87
"functions": [

schema/auth.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"$id": "https://serverlessworkflow.io/schemas/0.8/auth.json",
2+
"$id": "https://serverlessworkflow.io/schemas/0.9/auth.json",
33
"$schema": "http://json-schema.org/draft-07/schema#",
44
"description": "Serverless Workflow specification - auth schema",
55
"type": "object",

schema/common.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"$id": "https://serverlessworkflow.io/schemas/0.8/common.json",
2+
"$id": "https://serverlessworkflow.io/schemas/0.9/common.json",
33
"$schema": "http://json-schema.org/draft-07/schema#",
44
"description": "Serverless Workflow specification - common schema",
55
"type": "object",

schema/errors.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"$id": "https://serverlessworkflow.io/schemas/0.8/errors.json",
2+
"$id": "https://serverlessworkflow.io/schemas/0.9/errors.json",
33
"$schema": "http://json-schema.org/draft-07/schema#",
44
"description": "Serverless Workflow specification - errors schema",
55
"type": "object",

schema/events.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"$id": "https://serverlessworkflow.io/schemas/0.8/events.json",
2+
"$id": "https://serverlessworkflow.io/schemas/0.9/events.json",
33
"$schema": "http://json-schema.org/draft-07/schema#",
44
"description": "Serverless Workflow specification - events schema",
55
"type": "object",

schema/extensions.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"$id": "https://serverlessworkflow.io/schemas/0.8/extensions.json",
2+
"$id": "https://serverlessworkflow.io/schemas/0.9/extensions.json",
33
"$schema": "http://json-schema.org/draft-07/schema#",
44
"description": "Serverless Workflow specification - extensions schema",
55
"type": "object",

schema/functions.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"$id": "https://serverlessworkflow.io/schemas/0.8/functions.json",
2+
"$id": "https://serverlessworkflow.io/schemas/0.9/functions.json",
33
"$schema": "http://json-schema.org/draft-07/schema#",
44
"description": "Serverless Workflow specification - functions schema",
55
"type": "object",

schema/odata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"$id": "https://serverlessworkflow.io/schemas/0.8/odata.json",
2+
"$id": "https://serverlessworkflow.io/schemas/0.9/odata.json",
33
"$schema": "http://json-schema.org/draft-07/schema#",
44
"description": "Serverless Workflow specification - OData command options schema",
55
"type": "object",

schema/retries.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"$id": "https://serverlessworkflow.io/schemas/0.8/retries.json",
2+
"$id": "https://serverlessworkflow.io/schemas/0.9/retries.json",
33
"$schema": "http://json-schema.org/draft-07/schema#",
44
"description": "Serverless Workflow specification - retries schema",
55
"type": "object",

schema/secrets.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"$id": "https://serverlessworkflow.io/schemas/0.8/secrets.json",
2+
"$id": "https://serverlessworkflow.io/schemas/0.9/secrets.json",
33
"$schema": "http://json-schema.org/draft-07/schema#",
44
"description": "Serverless Workflow specification - secrets schema",
55
"type": "object",

schema/timeouts.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"$id": "https://serverlessworkflow.io/schemas/0.8/timeouts.json",
2+
"$id": "https://serverlessworkflow.io/schemas/0.9/timeouts.json",
33
"$schema": "http://json-schema.org/draft-07/schema#",
44
"description": "Serverless Workflow specification - functions schema",
55
"type": "object",

schema/workflow.json

Lines changed: 14 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,27 @@
11
{
2-
"$id": "https://serverlessworkflow.io/schemas/0.8/workflow.json",
2+
"$id": "https://serverlessworkflow.io/schemas/0.9/workflow.json",
33
"$schema": "http://json-schema.org/draft-07/schema#",
44
"description": "Serverless Workflow specification - workflow schema",
55
"type": "object",
66
"properties": {
7-
"id": {
8-
"type": "string",
9-
"description": "Workflow unique identifier",
10-
"minLength": 1
11-
},
12-
"key": {
7+
"name": {
138
"type": "string",
14-
"description": "Domain-specific workflow identifier",
9+
"description": "The name that identifies the workflow definition, and which, when combined with its version, forms a unique identifier.",
10+
"pattern": "^[a-z0-9](-?[a-z0-9])*$",
1511
"minLength": 1
1612
},
17-
"name": {
13+
"version": {
1814
"type": "string",
19-
"description": "Workflow name",
20-
"minLength": 1
15+
"description": "Workflow version",
16+
"pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$"
2117
},
2218
"description": {
2319
"type": "string",
2420
"description": "Workflow description"
2521
},
26-
"version": {
22+
"key": {
2723
"type": "string",
28-
"description": "Workflow version",
29-
"minLength": 1,
30-
"pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$"
24+
"description": "Optional expression that will be used to generate a domain-specific workflow instance identifier"
3125
},
3226
"annotations": {
3327
"type": "array",
@@ -152,22 +146,11 @@
152146
}
153147
},
154148
"additionalProperties": false,
155-
"oneOf": [
156-
{
157-
"required": [
158-
"id",
159-
"specVersion",
160-
"states"
161-
]
162-
},
163-
{
164-
"required": [
165-
"key",
166-
"specVersion",
167-
"states"
168-
]
169-
}
170-
],
149+
"required": [
150+
"name",
151+
"specVersion",
152+
"states"
153+
],
171154
"definitions": {
172155
"sleep": {
173156
"type": "object",

0 commit comments

Comments
 (0)