Skip to content
Merged
Show file tree
Hide file tree
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
27 changes: 27 additions & 0 deletions api/src/main/resources/schema/default/defaultdef.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"type": "object",
"javaType": "io.serverlessworkflow.api.defaultdef.DefaultDefinition",
"description": "Switch state default definition",
"properties": {
"transition": {
"$ref": "../transitions/transition.json",
"description": "Next transition of the workflow if there is valid matches"
},
"end": {
"$ref": "../end/end.json",
"description": "Explicit transition to end"
}
},
"oneOf": [
{
"required": [
"transition"
]
},
{
"required": [
"end"
]
}
]
}
2 changes: 1 addition & 1 deletion api/src/main/resources/schema/states/switchstate.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"description": "If eventConditions is used, defines the time period to wait for events (ISO 8601 format)"
},
"default": {
"$ref": "../transitions/transition.json"
"$ref": "../default/defaultdef.json"
}
},
"required": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
"transition": {
"$ref": "../transitions/transition.json",
"description": "Next transition of the workflow if there is valid matches"
},
"end": {
"$ref": "../end/end.json",
"description": "Explicit transition to end"
}
},
"required": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
"transition": {
"$ref": "../transitions/transition.json",
"description": "Next transition of the workflow if there is valid matches"
},
"end": {
"$ref": "../end/end.json",
"description": "Explicit transition to end"
}
},
"required": [
Expand Down
4 changes: 3 additions & 1 deletion api/src/test/resources/examples/applicantrequest.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@
}
],
"default": {
"nextState": "RejectApplication"
"transition": {
"nextState": "RejectApplication"
}
}
},
{
Expand Down
6 changes: 4 additions & 2 deletions api/src/test/resources/examples/applicantrequest.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
id: applicantrequest
version: '1.0'
name: Applicant Request Decision Workflow
Expand All @@ -18,7 +19,8 @@ states:
transition:
nextState: RejectApplication
default:
nextState: RejectApplication
transition:
nextState: RejectApplication
- name: StartApplication
type: subflow
workflowId: startApplicationWorkflowId
Expand All @@ -33,4 +35,4 @@ states:
parameters:
applicant: "{{ $.applicant }}"
end:
kind: default
kind: default
4 changes: 3 additions & 1 deletion api/src/test/resources/examples/creditcheck.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@
}
],
"default": {
"nextState": "RejectApplication"
"transition": {
"nextState": "RejectApplication"
}
}
},
{
Expand Down
6 changes: 4 additions & 2 deletions api/src/test/resources/examples/creditcheck.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
id: customercreditcheck
version: '1.0'
name: Customer Credit Check Workflow
Expand Down Expand Up @@ -38,7 +39,8 @@ states:
transition:
nextState: RejectApplication
default:
nextState: RejectApplication
transition:
nextState: RejectApplication
- name: StartApplication
type: subflow
workflowId: startApplicationWorkflowId
Expand All @@ -53,4 +55,4 @@ states:
parameters:
applicant: "{{ $.customer }}"
end:
kind: default
kind: default
4 changes: 3 additions & 1 deletion api/src/test/resources/examples/eventbasedtransition.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@
],
"eventTimeout": "PT1H",
"default": {
"nextState": "HandleNoVisaDecision"
"transition": {
"nextState": "HandleNoVisaDecision"
}
}
},
{
Expand Down
6 changes: 4 additions & 2 deletions api/src/test/resources/examples/eventbasedtransition.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
id: eventbasedswitch
version: '1.0'
name: Event Based Switch Transitions
Expand All @@ -23,7 +24,8 @@ states:
nextState: HandleRejectedVisa
eventTimeout: PT1H
default:
nextState: HandleNoVisaDecision
transition:
nextState: HandleNoVisaDecision
- name: HandleApprovedVisa
type: subflow
workflowId: handleApprovedVisaWorkflowID
Expand All @@ -38,4 +40,4 @@ states:
type: subflow
workflowId: handleNoVisaDecisionWorkfowId
end:
kind: default
kind: default
4 changes: 3 additions & 1 deletion api/src/test/resources/examples/jobmonitoring.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,9 @@
}
],
"default": {
"nextState": "WaitForCompletion"
"transition": {
"nextState": "WaitForCompletion"
}
}
},
{
Expand Down
6 changes: 4 additions & 2 deletions api/src/test/resources/examples/jobmonitoring.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
id: jobmonitoring
version: '1.0'
name: Job Monitoring
Expand Down Expand Up @@ -68,7 +69,8 @@ states:
transition:
nextState: JobFailed
default:
nextState: WaitForCompletion
transition:
nextState: WaitForCompletion
- name: JobSucceeded
type: operation
actionMode: sequential
Expand All @@ -88,4 +90,4 @@ states:
parameters:
name: "{{ $.jobuid }}"
end:
kind: default
kind: default