Skip to content

Commit

Permalink
Merge branch 'v1.14' into issue_4117
Browse files Browse the repository at this point in the history
  • Loading branch information
hhunter-ms authored Sep 11, 2024
2 parents 54730f7 + 6ee5968 commit c8c99e3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -646,25 +646,24 @@ OrderPayload orderInfo = new OrderPayload(itemToPurchase, 15000, ammountToPurcha
// Start the workflow
Console.WriteLine("Starting workflow {0} purchasing {1} {2}", orderId, ammountToPurchase, itemToPurchase);
await daprClient.StartWorkflowAsync(
workflowComponent: DaprWorkflowComponent,
workflowName: nameof(OrderProcessingWorkflow),
await daprWorkflowClient.ScheduleNewWorkflowAsync(
name: nameof(OrderProcessingWorkflow),
input: orderInfo,
instanceId: orderId);
// Wait for the workflow to start and confirm the input
GetWorkflowResponse state = await daprClient.WaitForWorkflowStartAsync(
instanceId: orderId,
workflowComponent: DaprWorkflowComponent);
WorkflowState state = await daprWorkflowClient.WaitForWorkflowStartAsync(
instanceId: orderId);
Console.WriteLine("Your workflow has started. Here is the status of the workflow: {0}", state.RuntimeStatus);
Console.WriteLine($"{nameof(OrderProcessingWorkflow)} (ID = {orderId}) started successfully with {state.ReadInputAs<OrderPayload>()}");
// Wait for the workflow to complete
using var ctx = new CancellationTokenSource(TimeSpan.FromSeconds(5));
state = await daprClient.WaitForWorkflowCompletionAsync(
instanceId: orderId,
workflowComponent: DaprWorkflowComponent);
cancellation: ctx.Token);
Console.WriteLine("Workflow Status: {0}", state.RuntimeStatus);
Console.WriteLine("Workflow Status: {0}", state.ReadCustomStatusAs<string>());
```
#### `order-processor/Workflows/OrderProcessingWorkflow.cs`
Expand Down Expand Up @@ -715,7 +714,7 @@ class OrderProcessingWorkflow : Workflow<OrderPayload, OrderResult>
nameof(UpdateInventoryActivity),
new PaymentRequest(RequestId: orderId, order.Name, order.Quantity, order.TotalCost));
}
catch (TaskFailedException)
catch (WorkflowTaskFailedException)
{
// Let them know their payment was processed
await context.CallActivityAsync(
Expand Down
2 changes: 1 addition & 1 deletion daprdocs/content/en/reference/api/jobs_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ Entry | Description | Equivalent
{
"data": {
"@type": "type.googleapis.com/google.protobuf.StringValue",
"value": "\"someData\""
"value": "someData"
},
"dueTime": "30s"
}
Expand Down

0 comments on commit c8c99e3

Please sign in to comment.