|
23 | 23 | + [Using multiple data filters](#using-multiple-data-filters)
|
24 | 24 | + [Data Merging](#data-merging)
|
25 | 25 | * [Workflow Functions](#workflow-functions)
|
26 |
| - + [Using Functions For RESTful Service Invocations](#using-functions-for-restful-service-invocations) |
27 |
| - + [Using Functions For RPC Service Invocations](#using-functions-for-rpc-service-invocations) |
28 |
| - + [Using Functions For GraphQL Service Invocations](#using-functions-for-graphql-service-invocations) |
| 26 | + + [Using Functions for RESTful Service Invocations](#using-functions-for-restful-service-invocations) |
| 27 | + + [Using Functions for RPC Service Invocations](#using-functions-for-rpc-service-invocations) |
| 28 | + + [Using Functions for GraphQL Service Invocations](#using-functions-for-graphql-service-invocations) |
29 | 29 | - [Invoking a GraphQL `Query`](#invoking-a-graphql-query)
|
30 | 30 | - [Invoking a GraphQL `Mutation`](#invoking-a-graphql-mutation)
|
31 |
| - + [Using Functions For Expression Evaluation](#using-functions-for-expression-evaluation) |
| 31 | + + [Using Functions for OData Service Invocations](#using-functions-for-odata-service-invocations) |
| 32 | + - [Creating an OData Function Definition](#creating-an-odata-function-definition) |
| 33 | + - [Invoking an OData Function Definition](#invoking-an-odata-function-definition) |
| 34 | + + [Using Functions for Expression Evaluation](#using-functions-for-expression-evaluation) |
32 | 35 | * [Workflow Expressions](#workflow-expressions)
|
33 | 36 | * [Workflow Definition Structure](#workflow-definition-structure)
|
34 | 37 | + [Workflow States](#workflow-states)
|
@@ -1029,7 +1032,7 @@ Reference the following sections to learn more about workflow functions:
|
1029 | 1032 | * [Using functions for GraphQL service invocation](#Using-Functions-For-GraphQL-Service-Invocations)
|
1030 | 1033 | * [Using functions for expression evaluations](#Using-Functions-For-Expression-Evaluation)
|
1031 | 1034 |
|
1032 |
| -#### Using Functions For RESTful Service Invocations |
| 1035 | +#### Using Functions for RESTful Service Invocations |
1033 | 1036 |
|
1034 | 1037 | [Functions](#Function-Definition) can be used to describe services and their operations that need to be invoked during
|
1035 | 1038 | workflow execution. They can be referenced by states [action definitions](#Action-Definition) to clearly
|
@@ -1086,7 +1089,7 @@ Note that the referenced function definition type in this case must be `rest` (d
|
1086 | 1089 |
|
1087 | 1090 | For more information about functions, reference the [Functions definitions](#Function-Definition) section.
|
1088 | 1091 |
|
1089 |
| -#### Using Functions For RPC Service Invocations |
| 1092 | +#### Using Functions for RPC Service Invocations |
1090 | 1093 |
|
1091 | 1094 | Similar to defining invocations of operations on RESTful services, you can also use the workflow
|
1092 | 1095 | [functions definitions](#Function-Definition) that follow the remote procedure call (RPC) protocol.
|
@@ -1149,7 +1152,7 @@ Note that the referenced function definition type in this case must be `rpc`.
|
1149 | 1152 |
|
1150 | 1153 | For more information about functions, reference the [Functions definitions](#Function-Definition) section.
|
1151 | 1154 |
|
1152 |
| -#### Using Functions For GraphQL Service Invocations |
| 1155 | +#### Using Functions for GraphQL Service Invocations |
1153 | 1156 |
|
1154 | 1157 | If you want to use GraphQL services, you can also invoke them using a similar syntax to the above methods.
|
1155 | 1158 |
|
@@ -1294,9 +1297,60 @@ Note that GraphQL Subscriptions are not supported at this time.
|
1294 | 1297 |
|
1295 | 1298 | For more information about functions, reference the [Functions definitions](#Function-Definition) section.
|
1296 | 1299 |
|
1297 |
| -#### Using Functions For Expression Evaluation |
| 1300 | +#### Using Functions for OData Service Invocations |
1298 | 1301 |
|
1299 |
| -In addition to defining RESTful, RPC and GraphQL services and their operations, workflow [functions definitions](#Function-Definition) |
| 1302 | +Similar to defining invocations of operations on GraphQL services, you can also use workflow |
| 1303 | +[Functions Definitions](#Function-Definition) to execute complex queries on an [OData](https://www.odata.org/documentation/) service. |
| 1304 | + |
| 1305 | +##### Creating an OData Function Definition |
| 1306 | + |
| 1307 | +We start off by creating a workflow [Functions Definitions](#Function-Definition). For example: |
| 1308 | + |
| 1309 | + |
| 1310 | +```json |
| 1311 | +{ |
| 1312 | +"functions": [ |
| 1313 | + { |
| 1314 | + "name": "queryPersons", |
| 1315 | + "operation": "https://services.odata.org/V3/OData/OData.svc#Persons", |
| 1316 | + "type": "odata" |
| 1317 | + } |
| 1318 | +] |
| 1319 | +} |
| 1320 | +``` |
| 1321 | + |
| 1322 | +Note that the `operation` property must follow the following format: |
| 1323 | + |
| 1324 | +```text |
| 1325 | +<URI_to_odata_service>#<Entity_Set_Name> |
| 1326 | +``` |
| 1327 | + |
| 1328 | +##### Invoking an OData Function Definition |
| 1329 | + |
| 1330 | +In order to invoke the defined [OData](https://www.odata.org/documentation/) function, |
| 1331 | +simply reference it in a workflow [Action Definition](#Action-Definition) and set its function arguments. For example: |
| 1332 | + |
| 1333 | +```json |
| 1334 | +{ |
| 1335 | + "refName": "queryPersons", |
| 1336 | + "arguments": { |
| 1337 | + "queryOptions":{ |
| 1338 | + "expand": "PersonDetail/Person", |
| 1339 | + "select": "Id, PersonDetail/Person/Name", |
| 1340 | + "top": 5, |
| 1341 | + "orderby": "PersonDetail/Person/Name" |
| 1342 | + } |
| 1343 | + } |
| 1344 | +} |
| 1345 | +``` |
| 1346 | + |
| 1347 | +In order to ensure compatibility of OData support across runtimes, |
| 1348 | +the`arguments` property of an [OData](https://www.odata.org/documentation/) function reference |
| 1349 | +should follow the Serverless Workflow [OData Json schema](https://github.com/serverlessworkflow/specification/tree/main/schema/odata.json) |
| 1350 | + |
| 1351 | +#### Using Functions for Expression Evaluation |
| 1352 | + |
| 1353 | +In addition to defining RESTful, RPC, GraphQL and OData services and their operations, workflow [functions definitions](#Function-Definition) |
1300 | 1354 | can also be used to define expressions that should be evaluated during workflow execution.
|
1301 | 1355 |
|
1302 | 1356 | Defining expressions as part of function definitions has the benefit of being able to reference
|
@@ -2969,8 +3023,8 @@ section.
|
2969 | 3023 | | Parameter | Description | Type | Required |
|
2970 | 3024 | | --- | --- | --- | --- |
|
2971 | 3025 | | name | Unique function name | string | yes |
|
2972 |
| -| operation | If type is `rest`, <path_to_openapi_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 `expression`, defines the workflow expression. | string | no | |
2973 |
| -| type | Defines the function type. Is either `rest`, `rpc` or `expression`. Default is `rest` | enum | no | |
| 3026 | +| operation | If type is `rest`, <path_to_openapi_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 | |
| 3027 | +| type | Defines the function type. Is either `rest`, `rpc`, `odata` or `expression`. Default is `rest` | enum | no | |
2974 | 3028 | | authRef | References an [auth definition](#Auth-Definition) name to be used to access to resource defined in the operation parameter | string | no |
|
2975 | 3029 | | [metadata](#Workflow-Metadata) | Metadata information. Can be used to define custom function information | object | no |
|
2976 | 3030 |
|
@@ -3017,7 +3071,9 @@ Depending on the function `type`, the `operation` property can be:
|
3017 | 3071 | * If `type` is `rpc`, a combination of the gRPC proto document URI and the particular service name and service method name that needs to be invoked, separated by a '#'.
|
3018 | 3072 | For example `file://myuserservice.proto#UserService#ListUsers`.
|
3019 | 3073 | * If `type` is `graphql`, a combination of the GraphQL schema definition URI and the particular service name and service method name that needs to be invoked, separated by a '#'.
|
3020 |
| - For example `file://myuserservice.proto#UserService#ListUsers`. |
| 3074 | + For example `file://myuserservice.proto#UserService#ListUsers`. |
| 3075 | +* If `type` is `odata`, a combination of the GraphQL schema definition URI and the particular service name and service method name that needs to be invoked, separated by a '#'. |
| 3076 | + For example `https://https://services.odata.org/V3/OData/OData.svc#Products`. |
3021 | 3077 | * If `type` is `expression`, defines the expression syntax. Take a look at the [workflow expressions section](#Workflow-Expressions) for more information on this.
|
3022 | 3078 |
|
3023 | 3079 | The `authRef` property references a name of a defined workflow [auth definition](#Auth-Definition).
|
|
0 commit comments