mirror of https://github.com/dapr/quickstarts.git
Add workflow input and outputs to READMEs
Signed-off-by: Marc Duiker <marcduiker@users.noreply.github.com>
This commit is contained in:
parent
c369d3db78
commit
7214b5b414
|
@ -57,5 +57,22 @@ graph LR
|
|||
```
|
||||
|
||||
4. Use the POST request in the [`childworkflows.http`](./childworkflows.http) file to start the workflow.
|
||||
|
||||
The input of the workflow is an array with two strings:
|
||||
|
||||
```json
|
||||
[
|
||||
"Item 1",
|
||||
"Item 2"
|
||||
]
|
||||
```
|
||||
|
||||
5. Use the GET request in the [`childworkflows.http`](./childworkflows.http) file to get the status of the workflow.
|
||||
|
||||
The expected serialized output of the workflow is an array with two strings:
|
||||
|
||||
```txt
|
||||
"[\"Item 1 is processed as a child workflow.\",\"Item 2 is processed as a child workflow.\"]"
|
||||
```
|
||||
|
||||
6. Stop the Dapr Multi-App run process by pressing `Ctrl+C`.
|
||||
|
|
|
@ -72,5 +72,33 @@ graph LR
|
|||
```
|
||||
|
||||
4. Use the POST request in the [`order-workflow.http`](./order-workflow.http) file to start the workflow.
|
||||
|
||||
The input for the workflow is an `Order` object:
|
||||
|
||||
```json
|
||||
{
|
||||
"id": "{{orderId}}",
|
||||
"orderItem" : {
|
||||
"productId": "RBD001",
|
||||
"productName": "Rubber Duck",
|
||||
"quantity": 10,
|
||||
"totalPrice": 15.00
|
||||
},
|
||||
"customerInfo" : {
|
||||
"id" : "Customer1",
|
||||
"country" : "The Netherlands"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
5. Use the GET request in the [`order-workflow.http`](./order-workflow.http) file to get the status of the workflow.
|
||||
|
||||
The expected serialized output of the workflow is:
|
||||
|
||||
```txt
|
||||
{\"IsSuccess\":true,\"Message\":\"Order 2a28fd28-15c1-4594-93ec-eb088c6be4a3 processed successfully.\"}"
|
||||
```
|
||||
|
||||
*The Order ID is generated when making the request and is different each time.*
|
||||
|
||||
6. Stop the Dapr Multi-App run process by pressing `Ctrl+C`.
|
||||
|
|
|
@ -58,7 +58,7 @@ internal sealed class OrderWorkflow : Workflow<Order, OrderStatus>
|
|||
return new OrderStatus(IsSuccess: false, message);
|
||||
}
|
||||
|
||||
return new OrderStatus(IsSuccess: true, "Order {order.Id} processed successfully.");
|
||||
return new OrderStatus(IsSuccess: true, $"Order {order.Id} processed successfully.");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
@apphost=http://localhost:5260
|
||||
|
||||
### Start the OrderProcess workflow
|
||||
### Start the OrderWorkflow workflow
|
||||
# @name startWorkflowRequest
|
||||
@orderId={{$guid}}
|
||||
POST {{ apphost }}/start
|
||||
|
|
|
@ -50,5 +50,41 @@ graph LR
|
|||
```
|
||||
|
||||
4. Use the POST request in the [`externalevents.http`](./externalevents.http) file to start the workflow.
|
||||
|
||||
The input for the workflow is an `Order` object:
|
||||
|
||||
```json
|
||||
{
|
||||
"id": "{{orderId}}",
|
||||
"description": "Rubber ducks",
|
||||
"quantity": 100,
|
||||
"totalPrice": 500
|
||||
}
|
||||
```
|
||||
|
||||
5. Use the GET request in the [`externalevents.http`](./externalevents.http) file to get the status of the workflow.
|
||||
6. Stop the Dapr Multi-App run process by pressing `Ctrl+C`.
|
||||
|
||||
The workflow should still be running since it it waiting for an external event.
|
||||
|
||||
6. Use the POST request in the [`externalevents.http`](./externalevents.http) file to send an `approval-event` to the workflow.
|
||||
|
||||
The payload for the event is an `ApprovalStatus` object:
|
||||
|
||||
```json
|
||||
{
|
||||
"OrderId": "{{instanceId}}",
|
||||
"IsApproved": true
|
||||
}
|
||||
```
|
||||
|
||||
7. Again use the GET request in the [`externalevents.http`](./externalevents.http) file to get the status of the workflow. The workflow should now be completed.
|
||||
|
||||
The expected serialized output of the workflow is:
|
||||
|
||||
```txt
|
||||
"\"Order 15b18587-86d6-4cb2-8496-8d60ab350a43 has been approved.\""
|
||||
```
|
||||
|
||||
*The Order ID is generated when making the request and is different each time.*
|
||||
|
||||
8. Stop the Dapr Multi-App run process by pressing `Ctrl+C`.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
@apphost=http://localhost:5258
|
||||
|
||||
### Start the Monitor workflow
|
||||
### Start the ExternalEventsWorkflow workflow
|
||||
# @name startWorkflowRequest
|
||||
@orderId={{$guid}}
|
||||
POST {{ apphost }}/start
|
||||
|
|
|
@ -41,5 +41,25 @@ graph LR
|
|||
```
|
||||
|
||||
4. Use the POST request in the [`fanoutfanin.http`](./fanoutfanin.http) file to start the workflow.
|
||||
|
||||
The input for the workflow is an array of strings:
|
||||
|
||||
```json
|
||||
[
|
||||
"which",
|
||||
"word",
|
||||
"is",
|
||||
"the",
|
||||
"shortest"
|
||||
]
|
||||
```
|
||||
|
||||
5. Use the GET request in the [`fanoutfanin.http`](./fanoutfanin.http) file to get the status of the workflow.
|
||||
|
||||
The expected serialized output of the workflow is:
|
||||
|
||||
```txt
|
||||
"\"is\""
|
||||
```
|
||||
|
||||
6. Stop the Dapr Multi-App run process by pressing `Ctrl+C`.
|
||||
|
|
|
@ -37,5 +37,15 @@ graph LR
|
|||
```
|
||||
|
||||
4. Use the POST request in the [`basics.http`](./basics.http) file to start the workflow.
|
||||
|
||||
The input for the workflow is a string with the value `One`.
|
||||
|
||||
5. Use the GET request in the [`basics.http`](./basics.http) file to get the status of the workflow.
|
||||
|
||||
The expected serialized output of the workflow is:
|
||||
|
||||
```txt
|
||||
"\"One Two Three\""
|
||||
```
|
||||
|
||||
6. Stop the Dapr Multi-App run process by pressing `Ctrl+C`.
|
||||
|
|
|
@ -40,5 +40,17 @@ graph LR
|
|||
```
|
||||
|
||||
4. Use the POST request in the [`monitor.http`](./monitor.http) file to start the workflow.
|
||||
|
||||
The input for the workflow is an integer with the value `0`.
|
||||
|
||||
5. Use the GET request in the [`monitor.http`](./monitor.http) file to get the status of the workflow.
|
||||
|
||||
The expected serialized output of the workflow is:
|
||||
|
||||
```txt
|
||||
"\"Status is healthy after checking 3 times.\""
|
||||
```
|
||||
|
||||
*The actual number of checks can vary since some randomization is used in the `CheckStatus` activity.*
|
||||
|
||||
6. Stop the Dapr Multi-App run process by pressing `Ctrl+C`.
|
||||
|
|
|
@ -38,5 +38,15 @@ graph LR
|
|||
```
|
||||
|
||||
4. Use the POST request in the [`chaining.http`](./chaining.http) file to start the workflow.
|
||||
|
||||
The input for the workflow is a string with the value `This`.
|
||||
|
||||
5. Use the GET request in the [`chaining.http`](./chaining.http) file to get the status of the workflow.
|
||||
|
||||
The expected serialized output of the workflow is:
|
||||
|
||||
```txt
|
||||
"\"This is task chaining\""
|
||||
```
|
||||
|
||||
6. Stop the Dapr Multi-App run process by pressing `Ctrl+C`.
|
||||
|
|
Loading…
Reference in New Issue