Skip to content

Commit a07c08c

Browse files
authored
Merge pull request #106 from tsurdilo/removeworkflowid
remove workflowid from parallel and foreach states
2 parents 8e6f61b + 9384657 commit a07c08c

File tree

9 files changed

+5
-44
lines changed

9 files changed

+5
-44
lines changed

api/src/main/resources/schema/branches/branch.json

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,6 @@
1414
"type": "object",
1515
"$ref": "../actions/action.json"
1616
}
17-
},
18-
"workflowId": {
19-
"type": "string",
20-
"description": "Unique Id of a workflow to be executed in this branch"
2117
}
2218
},
2319
"oneOf": [
@@ -29,8 +25,7 @@
2925
},
3026
{
3127
"required": [
32-
"name",
33-
"workflowId "
28+
"name"
3429
]
3530
}
3631
]

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

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,6 @@
3535
"$ref": "../actions/action.json"
3636
}
3737
},
38-
"workflowId": {
39-
"type": "string",
40-
"description": "Unique Id of a workflow to be executed for each of the elements of inputCollection"
41-
},
4238
"usedForCompensation": {
4339
"type": "boolean",
4440
"default": false,
@@ -52,7 +48,6 @@
5248
"type",
5349
"inputCollection",
5450
"inputParameter",
55-
"workflowId",
5651
"end"
5752
]
5853
},
@@ -62,7 +57,6 @@
6257
"type",
6358
"inputCollection",
6459
"inputParameter",
65-
"workflowId",
6660
"transition"
6761
]
6862
},
@@ -73,7 +67,6 @@
7367
"type",
7468
"inputCollection",
7569
"inputParameter",
76-
"workflowId",
7770
"end"
7871
]
7972
},
@@ -84,7 +77,6 @@
8477
"type",
8578
"inputCollection",
8679
"inputParameter",
87-
"workflowId",
8880
"transition"
8981
]
9082
},

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,10 @@
1111
"completionType": "allOf",
1212
"branches": [
1313
{
14-
"name": "ShortDelayBranch",
15-
"workflowId": "shortdelayworkflowid"
14+
"name": "ShortDelayBranch"
1615
},
1716
{
18-
"name": "LongDelayBranch",
19-
"workflowId": "longdelayworkflowid"
17+
"name": "LongDelayBranch"
2018
}
2119
],
2220
"end": true

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,5 @@ states:
99
completionType: allOf
1010
branches:
1111
- name: ShortDelayBranch
12-
workflowId: shortdelayworkflowid
1312
- name: LongDelayBranch
14-
workflowId: longdelayworkflowid
1513
end: true

diagram/src/main/java/io/serverlessworkflow/diagram/model/WorkflowDiagramModel.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -331,10 +331,6 @@ private void inspectStatesInfo(Workflow workflow) {
331331
if (forEachState.getActions() != null && forEachState.getActions().size() > 0) {
332332
modelState.addInfo("Num. of actions: " + forEachState.getActions().size());
333333
}
334-
335-
if (forEachState.getWorkflowId() != null && forEachState.getWorkflowId().length() > 0) {
336-
modelState.addInfo("Workflow ID: " + forEachState.getWorkflowId());
337-
}
338334
}
339335

340336
if (state instanceof CallbackState) {

diagram/src/test/resources/examples/parallel.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,10 @@
1111
"completionType": "allOf",
1212
"branches": [
1313
{
14-
"name": "ShortDelayBranch",
15-
"workflowId": "shortdelayworkflowid"
14+
"name": "ShortDelayBranch"
1615
},
1716
{
18-
"name": "LongDelayBranch",
19-
"workflowId": "longdelayworkflowid"
17+
"name": "LongDelayBranch"
2018
}
2119
],
2220
"end": true

diagram/src/test/resources/examples/parallel.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,5 @@ states:
99
completionType: allOf
1010
branches:
1111
- name: ShortDelayBranch
12-
workflowId: shortdelayworkflowid
1312
- name: LongDelayBranch
14-
workflowId: longdelayworkflowid
1513
end: true

validation/src/main/java/io/serverlessworkflow/validation/WorkflowValidatorImpl.java

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -314,14 +314,6 @@ public List<ValidationError> validate() {
314314
ValidationError.WORKFLOW_VALIDATION);
315315
}
316316

317-
318-
List<Branch> branches = parallelState.getBranches();
319-
for (Branch branch : branches) {
320-
if (branch.getWorkflowId() == null || branch.getWorkflowId().length() < 1) {
321-
addValidationError("Parallel state should define workflow id",
322-
ValidationError.WORKFLOW_VALIDATION);
323-
}
324-
}
325317
}
326318

327319
if (s instanceof InjectState) {
@@ -343,11 +335,6 @@ public List<ValidationError> validate() {
343335
addValidationError("ForEach state should have a valid iteration parameter",
344336
ValidationError.WORKFLOW_VALIDATION);
345337
}
346-
347-
if (forEachState.getWorkflowId() == null || forEachState.getWorkflowId().length() < 1) {
348-
addValidationError("ForEach state should define a workflow id",
349-
ValidationError.WORKFLOW_VALIDATION);
350-
}
351338
}
352339

353340
if (s instanceof CallbackState) {

validation/src/test/java/io/serverlessworkflow/validation/test/WorkflowValidationTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,6 @@ public void testOperationStateNoFunctionRef() {
124124
" \"type\": \"foreach\",\n" +
125125
" \"inputCollection\": \"${ .message }\",\n" +
126126
" \"iterationParam\": \"${ .singlemessage }\",\n" +
127-
" \"workflowId\": \"sendMessageWorkflowId\",\n" +
128127
" \"end\": {\n" +
129128
" \"kind\": \"default\"\n" +
130129
" }\n" +

0 commit comments

Comments
 (0)