mirror of https://github.com/dapr/docs.git
Merge branch 'v1.11' into issue_3323c
This commit is contained in:
commit
222fbf0b75
|
@ -151,25 +151,29 @@ string orderId = Guid.NewGuid().ToString()[..8];
|
|||
string itemToPurchase = "Cars";
|
||||
int ammountToPurchase = 10;
|
||||
|
||||
//...
|
||||
// Construct the order
|
||||
OrderPayload orderInfo = new OrderPayload(itemToPurchase, 15000, ammountToPurchase);
|
||||
|
||||
// Start the workflow
|
||||
Console.WriteLine("Starting workflow {0} purchasing {1} {2}", orderId, ammountToPurchase, itemToPurchase);
|
||||
|
||||
await workflowClient.ScheduleNewWorkflowAsync(
|
||||
name: nameof(OrderProcessingWorkflow),
|
||||
await daprClient.StartWorkflowAsync(
|
||||
workflowComponent: DaprWorkflowComponent,
|
||||
workflowName: nameof(OrderProcessingWorkflow),
|
||||
input: orderInfo,
|
||||
instanceId: orderId);
|
||||
|
||||
// Wait for the workflow to start and confirm the input
|
||||
GetWorkflowResponse state = await daprClient.WaitForWorkflowStartAsync(
|
||||
instanceId: orderId,
|
||||
input: orderInfo);
|
||||
workflowComponent: DaprWorkflowComponent);
|
||||
|
||||
//...
|
||||
Console.WriteLine("Your workflow has started. Here is the status of the workflow: {0}", state.RuntimeStatus);
|
||||
|
||||
WorkflowState state = await workflowClient.GetWorkflowStateAsync(
|
||||
// Wait for the workflow to complete
|
||||
state = await daprClient.WaitForWorkflowCompletionAsync(
|
||||
instanceId: orderId,
|
||||
getInputsAndOutputs: true);
|
||||
|
||||
Console.WriteLine("Your workflow has started. Here is the status of the workflow: {0}", state);
|
||||
|
||||
//...
|
||||
workflowComponent: DaprWorkflowComponent);
|
||||
|
||||
Console.WriteLine("Workflow Status: {0}", state.RuntimeStatus);
|
||||
```
|
||||
|
|
Loading…
Reference in New Issue