|
15 | 15 | + [HTTP](#http-call)
|
16 | 16 | + [OpenAPI](#openapi-call)
|
17 | 17 | - [Do](#do)
|
18 |
| - - [Fork](#fork) |
19 | 18 | - [Emit](#emit)
|
20 | 19 | - [For](#for)
|
| 20 | + - [Fork](#fork) |
21 | 21 | - [Listen](#listen)
|
22 | 22 | - [Raise](#raise)
|
23 | 23 | - [Run](#run)
|
@@ -242,6 +242,7 @@ The Serverless Workflow DSL defines a list of [tasks](#task) that **must be** su
|
242 | 242 |
|
243 | 243 | | Name | Type | Required | Description|
|
244 | 244 | |:--|:---:|:---:|:---|
|
| 245 | +| if | `string` | `no` | A [`runtime expression`](dsl.md#runtime-expressions), if any, used to determine whether or not the task should be run.<br>The task is considered skipped if not run. | |
245 | 246 | | input | [`input`](#input) | `no` | An object used to customize the task's input and to document its schema, if any. |
|
246 | 247 | | output | [`output`](#output) | `no` | An object used to customize the task's output and to document its schema, if any. |
|
247 | 248 | | export | [`export`](#export) | `no` | An object used to customize the content of the workflow context. |
|
|
473 | 474 | country: Portugal
|
474 | 475 | ```
|
475 | 476 |
|
476 |
| -#### Fork |
477 |
| - |
478 |
| -Allows workflows to execute multiple subtasks concurrently, enabling parallel processing and improving the overall efficiency of the workflow. By defining a set of subtasks to perform concurrently, the Fork task facilitates the execution of complex operations in parallel, ensuring that multiple tasks can be executed simultaneously. |
479 |
| - |
480 |
| -##### Properties |
481 |
| - |
482 |
| -| Name | Type | Required | Description| |
483 |
| -|:--|:---:|:---:|:---| |
484 |
| -| fork.branches | [`map[string, task][]`](#task) | `no` | The tasks to perform concurrently. | |
485 |
| -| fork.compete | `boolean` | `no` | Indicates whether or not the concurrent [`tasks`](#task) are racing against each other, with a single possible winner, which sets the composite task's output. Defaults to `false`. | |
486 |
| - |
487 |
| -##### Examples |
488 |
| - |
489 |
| -```yaml |
490 |
| -document: |
491 |
| - dsl: '1.0.0-alpha1' |
492 |
| - namespace: test |
493 |
| - name: fork-example |
494 |
| - version: '0.1.0' |
495 |
| -do: |
496 |
| - - raiseAlarm: |
497 |
| - fork: |
498 |
| - compete: true |
499 |
| - branches: |
500 |
| - - callNurse: |
501 |
| - call: http |
502 |
| - with: |
503 |
| - method: put |
504 |
| - endpoint: https://fake-hospital.com/api/v3/alert/nurses |
505 |
| - body: |
506 |
| - patientId: ${ .patient.fullName } |
507 |
| - room: ${ .room.number } |
508 |
| - - callDoctor: |
509 |
| - call: http |
510 |
| - with: |
511 |
| - method: put |
512 |
| - endpoint: https://fake-hospital.com/api/v3/alert/doctor |
513 |
| - body: |
514 |
| - patientId: ${ .patient.fullName } |
515 |
| - room: ${ .room.number } |
516 |
| -``` |
517 |
| - |
518 | 477 | #### Emit
|
519 | 478 |
|
520 | 479 | Allows workflows to publish events to event brokers or messaging systems, facilitating communication and coordination between different components and services. With the Emit task, workflows can seamlessly integrate with event-driven architectures, enabling real-time processing, event-driven decision-making, and reactive behavior based on incoming events.
|
|
588 | 547 | as: '.pets + [{ "id": $pet.id }]'
|
589 | 548 | ```
|
590 | 549 |
|
| 550 | +#### Fork |
| 551 | + |
| 552 | +Allows workflows to execute multiple subtasks concurrently, enabling parallel processing and improving the overall efficiency of the workflow. By defining a set of subtasks to perform concurrently, the Fork task facilitates the execution of complex operations in parallel, ensuring that multiple tasks can be executed simultaneously. |
| 553 | + |
| 554 | +##### Properties |
| 555 | + |
| 556 | +| Name | Type | Required | Description| |
| 557 | +|:--|:---:|:---:|:---| |
| 558 | +| fork.branches | [`map[string, task][]`](#task) | `no` | The tasks to perform concurrently. | |
| 559 | +| fork.compete | `boolean` | `no` | Indicates whether or not the concurrent [`tasks`](#task) are racing against each other, with a single possible winner, which sets the composite task's output. Defaults to `false`. | |
| 560 | + |
| 561 | +##### Examples |
| 562 | + |
| 563 | +```yaml |
| 564 | +document: |
| 565 | + dsl: '1.0.0-alpha1' |
| 566 | + namespace: test |
| 567 | + name: fork-example |
| 568 | + version: '0.1.0' |
| 569 | +do: |
| 570 | + - raiseAlarm: |
| 571 | + fork: |
| 572 | + compete: true |
| 573 | + branches: |
| 574 | + - callNurse: |
| 575 | + call: http |
| 576 | + with: |
| 577 | + method: put |
| 578 | + endpoint: https://fake-hospital.com/api/v3/alert/nurses |
| 579 | + body: |
| 580 | + patientId: ${ .patient.fullName } |
| 581 | + room: ${ .room.number } |
| 582 | + - callDoctor: |
| 583 | + call: http |
| 584 | + with: |
| 585 | + method: put |
| 586 | + endpoint: https://fake-hospital.com/api/v3/alert/doctor |
| 587 | + body: |
| 588 | + patientId: ${ .patient.fullName } |
| 589 | + room: ${ .room.number } |
| 590 | +``` |
| 591 | + |
| 592 | + |
591 | 593 | #### Listen
|
592 | 594 |
|
593 | 595 | Provides a mechanism for workflows to await and react to external events, enabling event-driven behavior within workflow systems.
|
|
0 commit comments