|
33 | 33 | - [Creating an OData Function Definition](#creating-an-odata-function-definition)
|
34 | 34 | - [Invoking an OData Function Definition](#invoking-an-odata-function-definition)
|
35 | 35 | + [Using Functions for Expression Evaluation](#using-functions-for-expression-evaluation)
|
| 36 | + + [Defining custom Function types](#defining-custom-function-types) |
36 | 37 | * [Workflow Expressions](#workflow-expressions)
|
37 | 38 | * [Workflow Definition Structure](#workflow-definition-structure)
|
38 | 39 | + [Workflow States](#workflow-states)
|
|
86 | 87 | + [Compensation Execution Details](#compensation-execution-details)
|
87 | 88 | + [Compensation and Active States](#compensation-and-active-states)
|
88 | 89 | + [Unrecoverable errors during compensation](#unrecoverable-errors-during-compensation)
|
89 |
| - * [Continuing as a new Execution](#continuing-as-a-new-execution) |
| 90 | + * [Continuing as a new Execution](#continuing-as-a-new-execution) |
90 | 91 | + [ContinueAs in sub workflows](#continueas-in-sub-workflows)
|
91 | 92 | * [Workflow Versioning](#workflow-versioning)
|
92 | 93 | * [Workflow Constants](#workflow-constants)
|
@@ -1033,9 +1034,12 @@ They can be referenced by their domain-specific names inside workflow [states](#
|
1033 | 1034 | Reference the following sections to learn more about workflow functions:
|
1034 | 1035 |
|
1035 | 1036 | * [Using functions for RESTful service invocations](#Using-Functions-For-RESTful-Service-Invocations)
|
| 1037 | +* [Using Functions for Async API Service Invocations](#Using-Functions-for-Async-API-Service-Invocations) |
1036 | 1038 | * [Using functions for gRPC service invocation](#Using-Functions-For-RPC-Service-Invocations)
|
1037 | 1039 | * [Using functions for GraphQL service invocation](#Using-Functions-For-GraphQL-Service-Invocations)
|
| 1040 | +* [Using Functions for OData Service Invocations](#Using-Functions-for-OData-Service-Invocations) |
1038 | 1041 | * [Using functions for expression evaluations](#Using-Functions-For-Expression-Evaluation)
|
| 1042 | +* [Defining custom function types](#defining-custom-function-types) |
1039 | 1043 |
|
1040 | 1044 | #### Using Functions for RESTful Service Invocations
|
1041 | 1045 |
|
@@ -1565,6 +1569,56 @@ For more information about functions, reference the [Functions definitions](#Fun
|
1565 | 1569 |
|
1566 | 1570 | For more information about workflow expressions, reference the [Workflow Expressions](#Workflow-Expressions) section.
|
1567 | 1571 |
|
| 1572 | +#### Defining custom function types |
| 1573 | + |
| 1574 | +[Function definitions](#function-definition) `type` property defines a list of function types that are set by |
| 1575 | +the specification. |
| 1576 | + |
| 1577 | +Some runtime implementations might support additional function types that extend the ones |
| 1578 | +defined in the specification. In those cases you can define a custom function type with for example: |
| 1579 | + |
| 1580 | +```json |
| 1581 | +{ |
| 1582 | +"functions": [ |
| 1583 | + { |
| 1584 | + "name": "sendOrderConfirmation", |
| 1585 | + "operation": "/path/to/my/script/order.ts#myFunction", |
| 1586 | + "type": "custom" |
| 1587 | + } |
| 1588 | +] |
| 1589 | +} |
| 1590 | +``` |
| 1591 | + |
| 1592 | +In this example we define a custom function type that is meant to execute an external [TypeScript](https://www.typescriptlang.org/) script. |
| 1593 | + |
| 1594 | +When a custom function type is specified, the operation property value has a **custom format**, meaning that |
| 1595 | +its format is controlled by the runtime which provides the custom function type. |
| 1596 | + |
| 1597 | +Later, the function should be able to be used in an action as any other function supported by the specification: |
| 1598 | + |
| 1599 | +```json |
| 1600 | +[{ |
| 1601 | + "states": [{ |
| 1602 | + "name": "handleOrder", |
| 1603 | + "type": "operation", |
| 1604 | + "actions": [ |
| 1605 | + { |
| 1606 | + "name": "sendOrderConfirmation", |
| 1607 | + "functionRef": { |
| 1608 | + "refName": "sendOrderConfirmation", |
| 1609 | + "arguments": { |
| 1610 | + "order": "${ .order }" |
| 1611 | + } |
| 1612 | + } |
| 1613 | + } |
| 1614 | + ], |
| 1615 | + "transition": "emailCustomer" |
| 1616 | + }] |
| 1617 | +}] |
| 1618 | +``` |
| 1619 | + |
| 1620 | +Note that custom function types are not portable across runtimes. |
| 1621 | + |
1568 | 1622 | ### Workflow Expressions
|
1569 | 1623 |
|
1570 | 1624 | Workflow model parameters can use expressions to select/manipulate workflow and/or state data.
|
@@ -3136,7 +3190,7 @@ section.
|
3136 | 3190 | | --- | --- | --- | --- |
|
3137 | 3191 | | name | Unique function name | string | yes |
|
3138 | 3192 | | operation | If type is `rest`, <path_to_openapi_definition>#<operation_id>. If type is `asyncapi`, <path_to_asyncapi_definition>#<operation_id>. If type is `rpc`, <path_to_grpc_proto_file>#<service_name>#<service_method>. If type is `graphql`, <url_to_graphql_endpoint>#<literal \"mutation\" or \"query\">#<query_or_mutation_name>. If type is `odata`, <URI_to_odata_service>#<Entity_Set_Name>. If type is `expression`, defines the workflow expression. | string | no |
|
3139 |
| -| type | Defines the function type. Is either `rest`, `asyncapi`, `rpc`, `graphql`, `odata` or `expression`. Default is `rest` | enum | no | |
| 3193 | +| type | Defines the function type. Can be either `rest`, `asyncapi`, `rpc`, `graphql`, `odata`, `expression`, or [`custom`](#defining-custom-function-types). Default is `rest` | enum | no | |
3140 | 3194 | | authRef | References an [auth definition](#Auth-Definition) name to be used to access to resource defined in the operation parameter | string | no |
|
3141 | 3195 | | [metadata](#Workflow-Metadata) | Metadata information. Can be used to define custom function information | object | no |
|
3142 | 3196 |
|
@@ -3190,6 +3244,8 @@ Depending on the function `type`, the `operation` property can be:
|
3190 | 3244 | For example `https://https://services.odata.org/V3/OData/OData.svc#Products`.
|
3191 | 3245 | * If `type` is `expression`, defines the expression syntax. Take a look at the [workflow expressions section](#Workflow-Expressions) for more information on this.
|
3192 | 3246 |
|
| 3247 | +Defining custom function types is possible, for more information on that refer to the [Defining custom function types](#defining-custom-function-types) section. |
| 3248 | + |
3193 | 3249 | The `authRef` property references a name of a defined workflow [auth definition](#Auth-Definition).
|
3194 | 3250 | It is used to provide authentication info to access the resource defined in the `operation` property.
|
3195 | 3251 |
|
|
0 commit comments