Click to view example definition
@@ -4151,10 +4132,9 @@ Allows defining invocation of a function via event.
```json
{
- "eventRef": {
- "produceEventRef": "make-vet-appointment",
+ "publish": {
+ "event": "make-vet-appointment",
"data": "${ .patientInfo }",
- "consumeEventRef": "vet-appointment-info"
}
}
```
@@ -4163,10 +4143,9 @@ Allows defining invocation of a function via event.
```yaml
-eventRef:
- produceEventRef: make-vet-appointment
+publish:
+ event: make-vet-appointment
data: "${ .patientInfo }"
- consumeEventRef: vet-appointment-info
```
|
@@ -4175,27 +4154,61 @@ eventRef:
-References a `produced` and `consumed` [event definitions](#Event-Definition) via the `produceEventRef` and `consumeEventRef` properties, respectively.
+Publish an [event definition](#Event-Definition) referenced via the `event` property.
The `data` property can have two types: string or object. If it is of string type, it is an expression that can select parts of state data
-to be used as payload of the event referenced by `produceEventRef`. If it is of object type, you can define a custom object to be the event payload.
+to be used as payload of the event referenced by `publish`. If it is of object type, you can define a custom object to be the event payload.
The `contextAttributes` property allows you to add one or more [extension context attributes](https://github.com/cloudevents/spec/blob/main/cloudevents/spec.md#extension-context-attributes)
to the trigger/produced event.
-The `consumeEventTimeout` property defines the maximum amount of time (ISO 8601 format literal or expression) to wait for the result event. If not defined it should default to the [actionExecutionTimeout](#Workflow-Timeout-Definition).
-If the event defined by the `consumeEventRef` property is not received in that set time, action invocation should raise an error
-that can be handled in the states `onErrors` definition. In case the `consumeEventRef` is not defined, the `consumeEventTimeout` property is ignored.
+##### Susbscribe Definition
-The `invoke` property defines how the function is invoked (sync or async). Default value of this property is
-`sync`, meaning that workflow execution should wait until the function completes (the result event is received).
-If set to `async`, workflow execution should just produce the trigger event and should not wait for the result event.
-Note that in this case the action does not produce any results (payload of the result event) and the associated actions eventDataFilter as well as
-its retry definition, if defined, should be ignored.
-Functions that are invoked via events (sync or async) do not propagate their errors to the associated action definition and the
-workflow state, meaning that any errors that happen during their execution cannot be handled in the workflow states
-onErrors definition. Note that errors raised during functions that are invoked sync or async in this case
-should not fail workflow execution.
+Wait for an event to arrive.
+
+| Parameter | Description | Type | Required |
+| --- | --- | --- | --- |
+| [event](#Event-Definition) | Reference to the unique name of an event definition. Must follow the [Serverless Workflow Naming Convention](#naming-convention) | string | yes |
+| timeout | Maximum amount of time (ISO 8601 format literal or expression) to wait for the consume event. If not defined it be set to the [actionExecutionTimeout](#Workflow-Timeout-Definition) | string | no |
+
+