Skip to content

Commit 0eb97e5

Browse files
authored
Merge pull request #104 from tsurdilo/switchstatedefaultup
update to switch state default condition
2 parents f3f7310 + 23ea010 commit 0eb97e5

29 files changed

+49
-49
lines changed

api/src/main/resources/schema/default/defaultdef.json renamed to api/src/main/resources/schema/defaultcondition/defaultconditiondef.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"type": "object",
3-
"javaType": "io.serverlessworkflow.api.defaultdef.DefaultDefinition",
4-
"description": "Switch state default definition",
3+
"javaType": "io.serverlessworkflow.api.defaultdef.DefaultConditionDefinition",
4+
"description": "Switch state default condition definition",
55
"properties": {
66
"transition": {
77
"$ref": "../transitions/transition.json",

api/src/main/resources/schema/states/switchstate.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@
2929
"type": "string",
3030
"description": "If eventConditions is used, defines the time period to wait for events (ISO 8601 format)"
3131
},
32-
"default": {
32+
"defaultCondition": {
3333
"description": "Default transition of the workflow if there is no matching data conditions. Can include a transition or end definition",
34-
"$ref": "../default/defaultdef.json"
34+
"$ref": "../defaultcondition/defaultconditiondef.json"
3535
},
3636
"usedForCompensation": {
3737
"type": "boolean",

api/src/test/java/io/serverlessworkflow/api/test/MarkupToWorkflowTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import io.serverlessworkflow.api.Workflow;
2020
import io.serverlessworkflow.api.actions.Action;
2121
import io.serverlessworkflow.api.datainputschema.DataInputSchema;
22-
import io.serverlessworkflow.api.defaultdef.DefaultDefinition;
22+
import io.serverlessworkflow.api.defaultdef.DefaultConditionDefinition;
2323
import io.serverlessworkflow.api.exectimeout.ExecTimeout;
2424
import io.serverlessworkflow.api.functions.FunctionDefinition;
2525
import io.serverlessworkflow.api.functions.FunctionRef;
@@ -196,8 +196,8 @@ public void testTransitions(String workflowLocation) {
196196
assertFalse(cond2.getTransition().isCompensate());
197197

198198

199-
assertNotNull(switchState.getDefault());
200-
DefaultDefinition defaultDefinition = switchState.getDefault();
199+
assertNotNull(switchState.getDefaultCondition());
200+
DefaultConditionDefinition defaultDefinition = switchState.getDefaultCondition();
201201
assertNotNull(defaultDefinition.getTransition());
202202
assertEquals("RejectApplication", defaultDefinition.getTransition().getNextState());
203203
assertNotNull(defaultDefinition.getTransition().getProduceEvents());

api/src/test/resources/examples/applicantrequest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"transition": "RejectApplication"
2525
}
2626
],
27-
"default": {
27+
"defaultCondition": {
2828
"transition": "RejectApplication"
2929
}
3030
},

api/src/test/resources/examples/applicantrequest.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ states:
1414
transition: StartApplication
1515
- condition: "${ .applicants | .age < 18 }"
1616
transition: RejectApplication
17-
default:
17+
defaultCondition:
1818
transition: RejectApplication
1919
- name: StartApplication
2020
type: operation

api/src/test/resources/examples/checkcarvitals.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
}
4242
}
4343
],
44-
"default": {
44+
"defaultCondition": {
4545
"transition": "WaitTwoMinutes"
4646
}
4747
},
@@ -76,7 +76,7 @@
7676
}
7777
}
7878
],
79-
"default": {
79+
"defaultCondition": {
8080
"transition": "CheckVitals"
8181
}
8282
}

api/src/test/resources/examples/checkcarvitals.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ states:
2020
produceEvents:
2121
- eventRef: DisplayFailedChecksOnDashboard
2222
data: "${ .evaluations }"
23-
default:
23+
defaultCondition:
2424
transition: WaitTwoMinutes
2525
- name: WaitTwoMinutes
2626
type: event
@@ -39,7 +39,7 @@ states:
3939
end:
4040
produceEvents:
4141
- eventRef: VitalsCheckingStopped
42-
default:
42+
defaultCondition:
4343
transition: CheckVitals
4444
events:
4545
- name: StopVitalsCheck

api/src/test/resources/examples/creditcheck.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
"transition": "RejectApplication"
5656
}
5757
],
58-
"default": {
58+
"defaultCondition": {
5959
"transition": "RejectApplication"
6060
}
6161
},

api/src/test/resources/examples/creditcheck.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ states:
3232
transition: StartApplication
3333
- condition: ${ .creditCheck | .decision == "Denied" }
3434
transition: RejectApplication
35-
default:
35+
defaultCondition:
3636
transition: RejectApplication
3737
- name: StartApplication
3838
type: operation

api/src/test/resources/examples/eventbasedtransition.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
}
3232
],
3333
"eventTimeout": "PT1H",
34-
"default": {
34+
"defaultCondition": {
3535
"transition": "HandleNoVisaDecision"
3636
}
3737
},

0 commit comments

Comments
 (0)