@@ -30,6 +30,7 @@ For this reason, the event, function, retry, and data mapping defined in the ass
30
30
- [ Error Handling with Retries] ( #Error-Handling-With-Retries )
31
31
- [ Process Execution Timeout] ( #Process-Execution-Timeout )
32
32
- [ Multiple Instance Subprocess] ( #Multiple-Instance-Subprocess )
33
+ - [ Loop Subprocess] ( #Loop-Subprocess )
33
34
- [ Approve Report (User Task)] ( #Approve-Report )
34
35
- [ Event Based Decision] ( #Event-Based-Decision )
35
36
@@ -305,26 +306,63 @@ functions:
305
306
</td>
306
307
<td valign="top">
307
308
309
+ ` ` ` yaml
310
+ id : foreachWorkflow
311
+ name : ForEach State Workflow
312
+ version : ' 1.0'
313
+ start : ForEachItem
314
+ states :
315
+ - name : ForEachItem
316
+ type : foreach
317
+ inputCollection : " ${ .inputsArray }"
318
+ iterationParam : " ${ .inputItem }"
319
+ outputCollection : " ${ .outputsArray }"
320
+ workflowId : doSomethingAndWaitForMessage
321
+ end : true
322
+ ` ` `
323
+
324
+ </td>
325
+ </tr>
326
+ </table>
327
+
328
+ * Note: We did not include the ` dosomethingandwaitformessage` workflow in this example, which would just include
329
+ a starting "operation" state transitioning to an "event" state which waits for the needed event.
330
+
331
+ # ## Loop Subprocess
332
+
333
+ <table>
334
+ <tr>
335
+ <th>BPMN2 Diagram</th>
336
+ <th>Serverless Workflow</th>
337
+ </tr>
338
+ <tr>
339
+ <td valign="top">
340
+ <p align="center">
341
+ <img src="../media/comparisons/bpmn/loop-subprocess.png" width="500px" alt="BPMN2 Loop Subprocess Workflow"/>
342
+ </p>
343
+ </td>
344
+ <td valign="top">
345
+
308
346
` ` ` yaml
309
347
id: subflowloop
310
- name : SubFlow Repeat workflow
348
+ name: SubFlow Loop Workflow
311
349
version: '1.0'
312
- start : SubflowRepeat
350
+ start: SubflowLoop
313
351
states:
314
- - name : SubflowRepeat
352
+ - name: SubflowLoop
315
353
type: subflow
316
- workflowId : dosomethingandwaitformessage
354
+ workflowId: checkAndReplyToEmail
317
355
repeat:
318
- max : 10
356
+ max: 100
319
357
end: true
320
358
` ` `
321
359
322
360
</td>
323
361
</tr>
324
362
</table>
325
363
326
- * Note: We did not include the ` dosomethingandwaitformessage ` workflow in this example, which would just include
327
- a starting "operation" state transitioning to an "event" state that waits for the needed event .
364
+ * Note: We did not include the `checkAndReplyToEmail ` workflow in this example, which would include the
365
+ control-flow logic to check email and make a decision to reply to it or wait an hour .
328
366
329
367
# ## Approve Report
330
368
0 commit comments